diff options
author | Mark Otto <markdotto@gmail.com> | 2021-01-12 08:02:26 +0300 |
---|---|---|
committer | Mark Otto <otto@github.com> | 2021-04-10 19:39:31 +0300 |
commit | 2d2f5b3dfd901bca22133ae25fdcce7afb4042c7 (patch) | |
tree | f37f7ba09f4470bda9936523235c5f38c291a867 /site/content/docs/5.0 | |
parent | c864852135b17a89bf2f3599212f5a4d3bd273f8 (diff) |
Add color-scheme mixin
Diffstat (limited to 'site/content/docs/5.0')
-rw-r--r-- | site/content/docs/5.0/customize/sass.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/site/content/docs/5.0/customize/sass.md b/site/content/docs/5.0/customize/sass.md index 0e0d3fe243..98a6429fb3 100644 --- a/site/content/docs/5.0/customize/sass.md +++ b/site/content/docs/5.0/customize/sass.md @@ -276,3 +276,25 @@ $border-width: 0; border-radius: subtract($border-radius, $border-width); } ``` + +## Mixins + +Our `scss/mixins/` directory has a ton of mixins that power parts of Bootstrap and can also be used across your own project. + +### Color schemes + +A shorthand mixin for the `prefers-color-scheme` media query is available with support for `light`, `dark`, and custom color schemes. + +{{< scss-docs name="mixin-color-scheme" file="scss/mixins/_color-scheme.scss" >}} + +```scss +.custom-element { + @include color-scheme(dark) { + // Insert dark mode styles here + } + + @include color-scheme(custom-named-scheme) { + // Insert custom color scheme styles here + } +} +``` |