Bootstrap: Better hover/active customization in button mixin

Created on 28 Oct 2016  路  2Comments  路  Source: twbs/bootstrap

See #19414.

Ideally we could do better than a specific darken/lighten value.

css v4

Most helpful comment

Ideally we could do better than a specific darken/lighten value.

If I may throw an idea out here. Perhaps we can use sass maps to define buttons styles?:

$buttons: (
  primary: (
    color: $white,
    background-color: $brand-primary,
    border-color: $brand-primary,
    hover-color: $white,
    hover-background-color: darken($brand-primary, 20%)
    hover-border-color: null // if not defined, fallback to border-color ? 
  ),
  outline-primary: ()  
  ...
)

Wouldn't it be more flexible? Because sometimes apart from the usual color change, I would also like to add other button types or remove those I don't need at all in my project. What you think? :)

All 2 comments

Ideally we could do better than a specific darken/lighten value.

If I may throw an idea out here. Perhaps we can use sass maps to define buttons styles?:

$buttons: (
  primary: (
    color: $white,
    background-color: $brand-primary,
    border-color: $brand-primary,
    hover-color: $white,
    hover-background-color: darken($brand-primary, 20%)
    hover-border-color: null // if not defined, fallback to border-color ? 
  ),
  outline-primary: ()  
  ...
)

Wouldn't it be more flexible? Because sometimes apart from the usual color change, I would also like to add other button types or remove those I don't need at all in my project. What you think? :)

Dupe of #19353.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eddywashere picture eddywashere  路  3Comments

fohlsom picture fohlsom  路  3Comments

steve-32a picture steve-32a  路  3Comments

devdelimited picture devdelimited  路  3Comments

tiendq picture tiendq  路  3Comments