Skip to content
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

Tracking: Color modes #37549

Open
54 of 81 tasks
Tracked by #2223
mdo opened this issue Nov 28, 2022 · 7 comments
Open
54 of 81 tasks
Tracked by #2223

Tracking: Color modes #37549

mdo opened this issue Nov 28, 2022 · 7 comments

Comments

@mdo
Copy link
Member

mdo commented Nov 28, 2022

Calling out some outstanding todos and questions from #35857 as we'll merge that PR and tackle these things in smaller batches.

General todos

Q&A

  • Why move some SVGs out of embedded CSS?
    • Makes CSS bundle smaller eventually (come v6)
    • Allows for use of inherited color as opposed to fixed colors, which requires repeating the entire SVG embed in CSS (adding to file size)

Docs todos

Issues

After alpha release

Other tasks

  • Create an issue to think to replace all occurrences of .text-muted by .text-body-secondary in v6

Issues raised by contributors

@septatrix
Copy link
Contributor

Another TODO I would like to add is that this should work without JS (which at least the preview in the PR does not). For the sake of accessibility and js-less users, it should default to respecting the system preferences. Thus, in its current form, the implementation also does not resolve #27514.

I would like to point out that this is the most upvoted comment in the PR (#35857 (comment)), second only to the "Any updates?" comment directly beneath it.

@XhmikosR

This comment was marked as outdated.

@septatrix
Copy link
Contributor

Another TODO I would like to add is that this should work without JS (which at least the preview in the PR does not). For the sake of accessibility and js-less users, it should default to respecting the system preferences. Thus, in its current form, the implementation also does not resolve #27514.

Any update on this aspect? It is not hard to include both mechanisms (prefers-color-scheme and data-bs-theme) though it obviously increases bundle size a bit. I see that the mechanism can be changed when compiling though only one of them can be selected at once, which is rather limiting. Especially considering that the whole theming mechanism is intended to make it easier to adjust color etc to one's' liking without having to compile a custom BS variant.

@chrisrodkey
Copy link

Can we generate the new subtle bg, subtle border, and text emphasis colors from $theme-colors?

This would be really valuable, for me. This is where I got very confused/lost. I have seen this PR here, but that seems to be focused on adding a custom color, and not on how to adapt the primary color into primary-subtle. This is just where I had to give up on the testing, as I'm just not sure how to proceed. Hopefully the docs can resolve that, but even more hopefully there will be a way to set the subtle colors automatically via the $theme-colors. Otherwise it's going to be a big challenge.

@carlosalvidrez
Copy link

I suggest classes "bg-light" and "bg-dark" get automatically swapped with the light/dark color mode toggle. Thank you for this great feature.

@duaneking
Copy link

It should be noted that the examples actually do not include full source, as it's missing javascript files.

@mellester
Copy link

Another TODO I would like to add is that this should work without JS (which at least the preview in the PR does not). For the sake of accessibility and js-less users, it should default to respecting the system preferences. Thus, in its current form, the implementation also does not resolve #27514.

Any update on this aspect? It is not hard to include both mechanisms (prefers-color-scheme and data-bs-theme) though it obviously increases bundle size a bit. I see that the mechanism can be changed when compiling though only one of them can be selected at once, which is rather limiting. Especially considering that the whole theming mechanism is intended to make it easier to adjust color etc to one's' liking without having to compile a custom BS variant.

Would a option like $color-mode-type: data-media-query
that bundles both and fallbacks to media if and only if there is no data-bs-theme set, be the thing we need? so no-js will respect the user settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: To do
Development

No branches or pull requests

8 participants