-
Notifications
You must be signed in to change notification settings - Fork 54
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
Auto color and bg-color with data-bs-theme #2313
Merged
julien-deramond
merged 12 commits into
main-jd-dark-mode
from
main-jd-dark-mode-new-data-bs-theme
Nov 29, 2023
Merged
Auto color and bg-color with data-bs-theme #2313
julien-deramond
merged 12 commits into
main-jd-dark-mode
from
main-jd-dark-mode-new-data-bs-theme
Nov 29, 2023
Conversation
This file contains 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
julien-deramond
added
the
color mode
Temporary label to highlight color mode issues
label
Oct 13, 2023
✅ Deploy Preview for boosted ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
louismaximepiton
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
from
October 17, 2023 14:14
21441eb
to
f641769
Compare
Merged
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
3 times, most recently
from
October 31, 2023 05:19
df0ac35
to
22bf6d9
Compare
Merged
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
2 times, most recently
from
November 3, 2023 11:30
03af5c3
to
f49a3ee
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
from
November 3, 2023 11:52
f641769
to
49312e0
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
2 times, most recently
from
November 6, 2023 07:18
35328ca
to
f0b8a1e
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
2 times, most recently
from
November 7, 2023 07:51
5cbf7e9
to
cf73de1
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
from
November 7, 2023 11:59
bc73b51
to
7fa6a42
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
2 times, most recently
from
November 8, 2023 08:27
ad18dca
to
2ef1cb4
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
from
November 8, 2023 13:54
6b93b32
to
af61298
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
from
November 8, 2023 13:56
2ef1cb4
to
b23e055
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
from
November 10, 2023 05:44
af61298
to
85428a8
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
from
November 10, 2023 05:45
b23e055
to
9fd4a45
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
from
November 13, 2023 06:08
85428a8
to
5326d71
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
2 times, most recently
from
November 13, 2023 07:43
c0d10b7
to
ae821eb
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
from
November 15, 2023 06:20
449b31f
to
8d5980c
Compare
julien-deramond
commented
Nov 29, 2023
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
julien-deramond
force-pushed
the
main-jd-dark-mode
branch
from
November 29, 2023 10:05
ada073f
to
7078b21
Compare
julien-deramond
force-pushed
the
main-jd-dark-mode-new-data-bs-theme
branch
from
November 29, 2023 10:06
0b149a7
to
06c0124
Compare
julien-deramond
added a commit
that referenced
this pull request
Nov 30, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 1, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 4, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 8, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 15, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 18, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 21, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 26, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Dec 27, 2023
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
julien-deramond
added a commit
that referenced
this pull request
Jan 2, 2024
Co-authored-by: louismaxime.piton <louismaxime.piton@orange.com>
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.
Description
This PR tries a new approach with an automatic set of
color:
andbackground-color:
linked to[data-bs-theme]
attribute.So when your create a
<div data-bs-theme="dark">
the content will be automatically rendered with a dark background and a white text in Boosted.Based on this modification, this PR also sets the Sass and/or CSS variables of components handling color and/or bg color to
null
by default, orinherit
, and also sometimes sets the background to transparent.More info
We decided to make big components (components with multiple layers) to inherit the color because it seemed more logical. Some components escape this logic such as spinners. It's because it's not really the color that is redefined but the use of
currentColor
.All this is due to a technical issue we have when the theme is set directly on the component.
If the component sets
color
at the top level, it overrides thecolor
coming from thedata-bs-theme
so if it's set tonull
orinherit
, it will inherit the color above and avoiddata-bs-theme
color
. On multiple-layer components it's easier to handle since we only need to avoid declaringcolor
at the top level of this component.Weird behavior for titles. For example
h1
-> Redefines color but.h1
-> inherits when the data theme is placed on them directly.For basic elements, form elements and input labels, we decided to keep the behavior as-is. Most likely the theme won't be applied to "basic" elements themselves. And the users could override this behavior if they are using this edge case.
Note
text-body
classes in dark mode page for basic elements introduced by Dark mode: basic elements #2355 to really test the impact of this PR in this context.We chose not to modify
color-mode()
mixin, here's why...Not covered in this PR
Based on this modification, it would be possible to do the following in components:
instead of the current in Bootstrap which doesn't work when a light accordion is declared within a dark container: