Customize font color #17066
Unanswered
kingsley8524267
asked this question in
General - Components / Directives / etc
Replies: 2 comments 1 reply
-
you can use $day-font-color: #333;
$night-font-color: #ccc;
$font-color: $day-font-color;
@mixin theme($theme) {
@if $theme == day {
$font-color: $day-font-color;
} @else if $theme == night {
$font-color: $night-font-color;
} @else {
@error "Unknown theme #{$theme}.";
}
}
body {
color: $font-color;
}
.theme-day {
@include theme(day);
}
.theme-night {
@include theme(night);
} Then you can add a btn.addEventListener('click', () => {
themeContainer.classList.toggle('theme-day');
themeContainer.classList.toggle('theme-night');
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
May I know what is themeContainer? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have 2 theme(day/night) and How can I customize the font-color in SCSS variable?
Beta Was this translation helpful? Give feedback.
All reactions