Button.primary.color applies background instead of label color
See original GitHub issuebutton.primary.color
sets background-color, instead of label color
Expected Behavior
button.primary.color
sets label color
When setting the color property for button variants, a CSS rule for color
should be applied to button element.
Actual Behavior
A background-color rule is applied instead, this making it impossible to overwrite colours for labels in button variants.
Steps to Reproduce
- set up your theme
global: {
colors: {
brand: '#A7893D'
},
font: {
family: 'Helvetica'
}
},
button: {
primary: {
color: 'salmon'
}
}
}
- run storybook
- see result
Your Environment
- Grommet version: grommet@2.13.0
- Browser Name and version: Chrome 81.0.4044.138
- Operating System and version (desktop or mobile): MacOS Catalina 10.15.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Label not change background color when my radio button ...
Check this you need to change the structure 1st input after label there is no way to select direct previous siblings, with your...
Read more >Bootstrap Buttons: Classes & Styles Explained - HubSpot Blog
Bootstrap button with sage green color defined by CSS class selector ... the CSS style property border-color instead of background-color.
Read more >Overriding Angular Material Component Colors - Wildcard Corp.
For example, if a blue button was desired but blue was not either the primary or accent color defined in your Material theme,...
Read more >How to Style the Selected Label of a Radio Button - W3docs
In this snippet, learn how you can style the selected label of a radio button. For that, you need to use the CSS...
Read more >How to change the background color after clicking the button ...
Given an HTML document and the task is to change the background color of the document using JavaScript and jQuery.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree with your comment. I think we should consider having separate color theme props for
color
andbackground.color
withinprimary
button.Regardless, please take a look at how I was able to impact the text color of primary button in this code snippet: https://codesandbox.io/s/themed-button-pp77f?file=/index.js
My issue is not related to the
primary
colour in theglobal.colors
object, but rather to the button variant calledprimary
-<Button primary {...} />
. I am trying to adjust the style for primary buttons, e.g. changing the label colour and its background colour. Now, I can see these being described in the documentation asbutton.primary.color
andbutton.primary.background.color
accordingly. However, changingbutton.primary.color
actually changes the background colour, andbutton.primary.background.color
is being ignored entirely. Am I missing something? According to the documentation, this is not intended behaviour.