if else scss

Solutions on MaxInterview for if else scss by the best coders in the world

showing results for - "if else scss"
Simone
28 Nov 2020
1$light-background: #f2ece4;
2$light-text: #036;
3$dark-background: #6b717f;
4$dark-text: #d2e1dd;
5
6@mixin theme-colors($light-theme: true) {
7  @if $light-theme {
8    background-color: $light-background;
9    color: $light-text;
10  } @else {
11    background-color: $dark-background;
12    color: $dark-text;
13  }
14}
15
16.banner {
17  @include theme-colors($light-theme: true);
18  body.dark & {
19    @include theme-colors($light-theme: false);
20  }
21}
22