-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Sass compilation breaking change in v5.3
- Loading branch information
1 parent
a4d2f59
commit 570cd24
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// TODO: this file can be removed safely in v6 when `@import "variables-dark"` will be removed at the end of _variables.scss | ||
|
||
// stylelint-disable selector-attribute-quotes | ||
|
||
@import "../../functions"; | ||
@import "../../variables"; | ||
// Voluntarily not importing _variables-dark.scss | ||
@import "../../maps"; | ||
@import "../../mixins"; | ||
|
||
@include describe("global $color-mode-type: data") { | ||
@include it("generates data attribute selectors for dark mode") { | ||
@include assert() { | ||
@include output() { | ||
@include color-mode(dark) { | ||
.element { | ||
color: var(--bs-primary-text-emphasis); | ||
background-color: var(--bs-primary-bg-subtle); | ||
} | ||
} | ||
@include color-mode(dark, true) { | ||
--custom-color: #{mix($indigo, $blue, 50%)}; | ||
} | ||
} | ||
@include expect() { | ||
[data-bs-theme=dark] .element { | ||
color: var(--bs-primary-text-emphasis); | ||
background-color: var(--bs-primary-bg-subtle); | ||
} | ||
[data-bs-theme=dark] { | ||
--custom-color: #3a3ff8; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@include describe("global $color-mode-type: media-query") { | ||
@include it("generates media queries for dark mode") { | ||
$color-mode-type: media-query !global; | ||
|
||
@include assert() { | ||
@include output() { | ||
@include color-mode(dark) { | ||
.element { | ||
color: var(--bs-primary-text-emphasis); | ||
background-color: var(--bs-primary-bg-subtle); | ||
} | ||
} | ||
@include color-mode(dark, true) { | ||
--custom-color: #{mix($indigo, $blue, 50%)}; | ||
} | ||
} | ||
@include expect() { | ||
@media (prefers-color-scheme: dark) { | ||
.element { | ||
color: var(--bs-primary-text-emphasis); | ||
background-color: var(--bs-primary-bg-subtle); | ||
} | ||
} | ||
@media (prefers-color-scheme: dark) { | ||
:root { | ||
--custom-color: #3a3ff8; | ||
} | ||
} | ||
} | ||
} | ||
|
||
$color-mode-type: data !global; | ||
} | ||
} |