-
-
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
Color mode: Customization of dark theme #38136
base: main
Are you sure you want to change the base?
Conversation
d06a692
to
56e908f
Compare
I haven't had the time to review it yet but I agree that it's needed. For example, see https://github.com/orgs/twbs/discussions/38255 and https://github.com/orgs/twbs/discussions/38259. Or simply in our Orange fork where our primary color changes depending on light and dark mode for a11y (contrasts) reasons. |
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.
First batch of comments. I haven't checked everything yet.
As said in my previous comment, I think this is mandatory for our color modes so that projects can switch the color palette in dark mode for a11y reasons.
Targeted version
IMO, this PR should be embedded directly in v5.3.2 instead of v5.4.0 in order to finalize the color modes in v5.3.x.
Bundle size
main branch:
PASS ./dist/css/bootstrap-reboot.css: 3.26KB < 3.5KB (gzip)
PASS ./dist/css/bootstrap-reboot.min.css: 3.1KB < 3.25KB (gzip)
PASS ./dist/css/bootstrap-utilities.css: 11.5KB < 11.75KB (gzip)
main-lmp-dark-theme-customization branch:
PASS ./dist/css/bootstrap-reboot.css: 3.27KB < 3.5KB (gzip)
PASS ./dist/css/bootstrap-reboot.min.css: 3.11KB < 3.25KB (gzip)
PASS ./dist/css/bootstrap-utilities.css: 11.51KB < 11.75KB (gzip)
This slight size change is acceptable IMO and is coming from the generation of the following custom properties in dark mode (already existing in light mode):
> --bs-primary: #0d6efd;
> --bs-secondary: #6c757d;
> --bs-success: #198754;
> --bs-info: #0dcaf0;
> --bs-warning: #ffc107;
> --bs-danger: #dc3545;
> --bs-light: #f8f9fa;
> --bs-dark: #212529;
> --bs-primary-rgb: 13, 110, 253;
> --bs-secondary-rgb: 108, 117, 125;
> --bs-success-rgb: 25, 135, 84;
> --bs-info-rgb: 13, 202, 240;
> --bs-warning-rgb: 255, 193, 7;
> --bs-danger-rgb: 220, 53, 69;
> --bs-light-rgb: 248, 249, 250;
> --bs-dark-rgb: 33, 37, 41;
Documentation
Here’s probably something to update:
https://twbs-bootstrap.netlify.app/docs/5.3/customize/color-modes/#adding-theme-colors(resolved)(resolved)$theme-colors-dark
should be added in docs/5.3/utilities/colors/#sass-maps (like$theme-colors-text-dark
)migration guide(resolved)
Issues
Have you checked whether this PR can close some existing issues in the tracker?
Another thing that is pretty problematic and that will maybe force us to land this PR in v6 only is that when As discussed, @louismaximepiton, I let you create a branch based on this one to check what would be the necessary changes in order to make the buttons dependent on |
Description
Add a new maps and associated Sass variables to allow a deeper customization.
Initialized it to what we have atm.
Motivation & Context
Facilitate a deeper customization of the dark mode basic colors.
Type of changes
Checklist
npm run lint
)Live previews
Related issues
Closes #39484.