Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Our team found a potential edge case while working on our Bootstrap fork.
When using the current version of
color-mode.js
:The results will be:
color-mode
on devicecolor-mode
on Bootstrap*
dark
data-bs-theme="dark"
*
light
data-bs-theme="light"
dark
auto
data-bs-theme="dark"
light
auto
data-bs-theme="auto"
At this point you may have an edge case when your device is set to 'Light mode' and you use the 'Auto color mode' on the page because you will have to add more CSS to make something like:
Proposed patch:
Then you will have:
color-mode
on devicecolor-mode
on Bootstrap*
dark
data-bs-theme="dark"
*
light
data-bs-theme="light"
dark
auto
data-bs-theme="dark"
light
auto
data-bs-theme="light"
And you don't need to add extra CSS everywhere.
Motivation & Context
Fix edge case when your device is set to 'Light mode' and you use the 'Auto color mode' on the page.
Type of changes
Checklist
npm run lint
)Live previews