Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67469

Scss setting value of variable in selector causes it to change even if no element with given selector is available

$
0
0

SCSS File

$dark-theme: false!default;
$primary-dark: blue;

[dark-mode='dark'] {
  background:gray!important;
  $dark-theme: true!global;
}

[dark-mode='light'] {
  background:yellow!important;
  $dark-theme: false!global;
}

@if $dark-theme==true{
  $primary-dark: black!global;
} @else{
  $primary-dark: blue!global;
}

HTML

<html>
<body dark-mode="dark">
</body>
</html>

The above code always sets $dark-theme value given in [dark-mode='light'] while background is set correctly


Viewing all articles
Browse latest Browse all 67469

Trending Articles