Skip to content

Commit

Permalink
fix(dark-mode-class): Top-level selectors may not contain the parent …
Browse files Browse the repository at this point in the history
…selector "&"

- Toggle the parameter $parent to false if you don't need the parent selector
  • Loading branch information
felix-berlin authored Sep 19, 2022
1 parent 3052423 commit 07f234d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mixins/_dark-mode-class.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
/// color: #fff;
/// }
///
@mixin dark-mode-class($element: 'html', $class: 'dark') {
#{$element}[class~="#{$class}"] & {
@mixin dark-mode-class($element: 'html', $parent: true, $class: 'dark') {
@if ($parent) {
#{$element}[class~="#{$class}"] & {
@content;
}
} @else {
#{$element}[class~="#{$class}"] {
@content;
}
}
}

0 comments on commit 07f234d

Please sign in to comment.