Fix light mode carousel in dark mode#40695
Merged
julien-deramond merged 3 commits intomainfrom Dec 19, 2024
Merged
Conversation
Co-authored-by: Louis-Maxime Piton <[email protected]>
louismaximepiton
approved these changes
Aug 6, 2024
Member
louismaximepiton
left a comment
There was a problem hiding this comment.
I'm fine with that, to be honest I still don't know if I'd prefer to have it in the _root.scss or in each component but the mechanism is great to me regarding the color mode approach.
Member
Author
For now, I prefer to have it in each component, as if one doesn't want to embed the accordion in your custom build, we wouldn't have extra useless rules. |
Member
Author
|
Reverted the |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.mdmodifications 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.scssuses 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