-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4: Colors redux #22836
v4: Colors redux #22836
Conversation
This PR seems to be a very good approach to me. It unites the good things from the current system and the closed PR. Thanks! My suggestions regarding the color palette:
|
This seems a very logical approach, although I wonder whether the concept of percentages could be used rather than 100 through to 900? |
@mdo This is a very good approach compared to old one! 👍 |
…xins, and generate card, button, bg, and color classes from the sass map
scss/mixins/_buttons.scss
Outdated
background-color: $active-background; | ||
border-color: $active-border; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains trailing whitespace
Looks much better than the last approach. Thanks for listening to the concerns :) |
@mdo IMHO a good starting point for $theme-colors map would be to include primary-secondary-faded-inverse-info-success-warning-danger. I can't understand background-foreground meaning. BTW color-yiq mixin and $theme-colors are super-usefull (Claps hands) |
These should be self explanatory—it's the foreground |
Ah ok. So putting foreground and background in $theme-colors maps ends up creating counterintuitive rules likes bg-foreground/bg-background. $body-bg and $body-color are not enough for that ? |
@mdo don't know if it helps but the plugin it's complaining about, in the tests, is present in the |
Still more to do:
Just pushed updates for tables and list groups. Still need a bit more refinement on these colors. |
Removed the old |
This PR supersedes #22551 with a slightly different approach to enabling more color usage while continuing to support the theme approach that the
$brand-
variables enable.New colors
I've updated all the color variables, though I'm still not 100% happy with them. I'm struggling to find the right way to create a legit palette here. However, it's getting closer thanks to Material, Open Color, and more. My intent here is that you can swap all the variables easily with other common color palettes from major systems (iOS, Android, etc). As such it's important to have the right number of colors in place to build on.
Dual Sass color maps
In #22551 I was pushing heavily towards a single Sass map, but not everyone builds on Bootstrap with Sass, so that limits options for those adding vanilla CSS on top of our code. As such, it's entirely possible
.btn-blue
could become a purple button.Now, we have two Sass maps,
$colors
and$theme-colors
, though they're not entirely implemented right now.$colors
is for every color.$theme-colors
is for a subset of those that you'd want to loop over to generate a customized color scheme. The intent is to use this theme Sass map to generate our alerts, buttons, backgrounds, etc.Grayscale
In addition to the two color maps, I've added a
$grays
Sass map and new variables. Instead of a few$gray-light
,$gray-dark
, etc variables, we have$gray-100
through$gray-900
. This provides greater flexibility, a consistent set of grays throughout, and the basis for future color updates. (Eventually every color should have all these shades.)Additional improvements
I'm after a number of things with a color update like this. First, I want more colors available to folks to pull from and more options to customize via CSS or Sass (our preferred method). Second, I want the tooling to be helpful, so color contrast functions and proper map values is important. Third, I want to provide more utilities for folks based on these colors (e.g., border color classes) while reducing component-based modifiers where appropriate (e.g., badge backgrounds can be
.bg-
classes).Todo
$theme-colors
map. I've added foreground/background, but are there more? Should it be fewer?map-get
functions are in place for each Sass map (think I'm missing grays right now)