Button hover colors should be in _variables.scss file
See original GitHub issueThe mixin for button-variant is defined like this:
@mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%))
Because of this, if you want to have the active background 10% darker or 7.5% lighter (for example) you either have to change the mixin file or write more custom css. This could be easily fixed:
/mixins/_buttons.scss
@mixin button-variant($background, $border, $active-background, $active-border)
_variables.scss
$active-background: darken($background, 7.5%);
$active-border: darken($border, 10%);
It looks as though this was probably the original intent, but somebody forgot to move those variables out of the mixin file.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:10 (1 by maintainers)
Top Results From Across the Web
All buttons hover styling in Twitter Bootstrap - Stack Overflow
Let's assume I would like to make it lighter. I looked at Buttons Less variables but I don't see button hover styling option....
Read more >How to change correctly color variable with SASS (for button
Go to sass/mdb/free/colors.scss file and find "success-color" variable. Change it, compile scss file to new css file and it will work. Add ...
Read more >How to apply hover effect over button using SASS
When hovering the opacity of the background color of buttons, it will slightly increase the width from 1px to 200px depending upon the...
Read more >Customizing the color scheme or typography - IBM
You can customize the color scheme to display different colors and typography by using Sass. Do not modify CSS files directly. You can...
Read more >What do you name color variables? | CSS-Tricks
The first thing I wanted to do was variablize my colors. From my naming-things-in-HTML skillz, I knew to avoid classes like .header-blue-left- ...
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 Free
Top 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

@andresgalante I find myself struggling with the button mixins often enough with the need to modify some states (especially the hard-coded percentages and ‘lighten’ vs ‘darken’). As far as I can see the approach of the opening comment wouldn’t work, not so much because of the confusion, but because the
$backgroundvariable is undefined until it gets set in the@eachloop in/scss/_buttons.scssHow about a solution along these lines – this approach would users let easily adjust the percentages as well as the color function:
/scss/mixins/_buttons.scss
/scss/_variables.scss
Can I do this?