-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fix *-dark
rule
#1293
Fix *-dark
rule
#1293
Conversation
✅ Deploy Preview for boosted ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
817155a
to
32000d4
Compare
Note: we need to check if it works with the new |
ab3fea6
to
b9a3f03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks good to me.
As said in the description, I also think we should mention somewhere in the documentation that those rules exist in order to be able to handle dark variants. Not a big fan of the place, but I'd said the most appropriate place is /docs/5.2/customize/color/
. I let you propose something so that we can iterate on.
FYI, code used to test different use cases (doesn't include cascade of divs with different bg colors):
<div class="container-fluid p-4">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
<div class="container-fluid p-4 border-dark border">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
<div class="container-fluid p-4 text-dark">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
<div class="container-fluid p-4 bg-black">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
<div class="container-fluid p-4 bg-dark">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
<div class="container-fluid p-4 bg-secondary">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
<div class="container-fluid p-4 text-bg-dark">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
<div class="container-fluid p-4 text-bg-secondary">
<div class="row">
<div class="col-12">
1. Text
<br>
2. <a href="/">Link</a>
<br>
3. <code>test</code>
<br>
4. <kbd>Ctrl</kbd>
<br>
5. <mark>highlight</mark>
<br>
6. <pre>pre content</pre>
</div>
</div>
</div>
Tried to place it with Root variables and component explanation. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Fixes #1174
Search
I've searched for every
-dark
class in Boosted and even for"dark"
word. It appears that every time it is called, this is for a background-color or at least a component that benefits from the rule. The only class that diverged was.border-dark
that changes the border-color. So I decided to keep the rule and precised that.border-dark
shouldn't interfere with it anymore.My concerns are for Boosted users since this is a general rule that could break existing sites. If you agree, we should at least warn somewhere about this rule and add it to the migration guide. If you think that this rule should be more specific, please let me know.
Miscellaneous (out of PR)
I also discovered that Bootstrap has abg-black
that could maybe be removed (which will simplify our utility) since it's not mentioned anywhere nor used. I couldn't spot any breaking change using this, but I added a selector to that rule to handle this specific case.Edit: Looks like this bg-black is wanted so let's keep it : twbs/bootstrap#34100
The second one is that we have plenty of classes.a11y-swatch-*
that aren't used yet insite/assets/scss/colors.scss
. Was wondering if we could use them to have maybe a better accessibility or visibility about this topic. Otherwise, they could be removed easily IMO.Edit: Issue created #1297.