Fix light mode carousel in dark mode #40695
Merged
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.
Caution
Before merging,
carousel.md
modifications must be revertedDescription
This work has been done in collaboration with @louismaximepiton, please don't remove the "Co-authored-by" from the commit message if merged
This PR tackles specifically #40493. This work is based on #39295 spirit.
The idea is to rely on custom properties so that there's never a specificity issue when nesting color modes (light mode in dark mode, and dark mode in light mode).
In order for it to be non-breaking,
_variables-dark.scss
uses the newly deprecated$carousel-dark-*
Sass variables.Please note that in the future, we'll be able to replace
:root, [data-bs-theme="light"] {
with@include color-mode(light, true)
as suggested in #39295.This part generates the following CSS:
After this PR
After this PR, we might do exactly the same thing for the problematic rendering of the accordions, close buttons, etc. and use the same technique.
@mdo and @twbs/css-review what do you think about this PR? Do you agree that it can be used, it doesn't bring regressions, and can be replicated for other issues (accordions, etc.)?
Type of changes
Checklist
npm run lint
)Live previews
Related issues
Closes #40493