Skip to content
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

Merged
merged 5 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scss/_root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@
--#{$prefix}highlight-bg: #{$mark-bg};
}

// scss-docs-start root-dark-rule
// Boosted mod
[class*="-dark"],
.bg-secondary {
[class*="bg-black"],
[class*="-dark"]:not(.border-dark):not(.text-dark),
[class*="bg-secondary"] {
--#{$prefix}link-color: #{$link-color-dark};
--#{$prefix}link-hover-color: #{$link-hover-color-dark};
--#{$boosted-prefix}caption-color: #{$table-caption-color-dark};
Expand All @@ -106,3 +108,4 @@
}
}
// End mod
// scss-docs-end root-dark-rule
8 changes: 8 additions & 0 deletions site/content/docs/5.2/customize/css-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ Have a look at our table documentation for some [insight into how we're using CS

Whenever possible, we'll assign CSS variables at the base component level (e.g., `.navbar` for navbar and its sub-components). This reduces guessing on where and how to customize, and allows for easy modifications by our team in future updates.

### Dark text rule

Using CSS variables allows a better flexibility on certain rules. This way we adapt our text variant color to our dark variants components instead of rewriting rules for each component. This process implies to override some existing CSS variables and to re-initialize those in some cases.

Here is our proposal to handle the different text variants over the website:

{{< scss-docs name="root-dark-rule" file="scss/_root.scss" >}}

## Prefix

Most CSS variables use a prefix to avoid collisions with your own codebase. This prefix is in addition to the `--` that's required on every CSS variable.
Expand Down