diff options
| author | Volpeon <git@volpeon.ink> | 2024-05-07 09:18:18 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2024-05-07 09:18:18 +0200 |
| commit | 963e786dc3c2a0c4fcb6a9b53900a79f40c36ba2 (patch) | |
| tree | 0824ce95311c395cc5750ae4f5835edec89af949 /src/_functions.scss | |
| parent | Replace dark theme with media theme (diff) | |
| download | iro-design-963e786dc3c2a0c4fcb6a9b53900a79f40c36ba2.tar.gz iro-design-963e786dc3c2a0c4fcb6a9b53900a79f40c36ba2.tar.bz2 iro-design-963e786dc3c2a0c4fcb6a9b53900a79f40c36ba2.zip | |
Add light media theme
Diffstat (limited to 'src/_functions.scss')
| -rw-r--r-- | src/_functions.scss | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/_functions.scss b/src/_functions.scss index 82e8435..148a28c 100644 --- a/src/_functions.scss +++ b/src/_functions.scss | |||
| @@ -105,8 +105,12 @@ | |||
| 105 | @return $result; | 105 | @return $result; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | @function gray-to-alpha($color) { | 108 | @function gray-to-alpha($lightness, $color) { |
| 109 | @return rgba(#fff, color.whiteness($color)); | 109 | @if $lightness >= 50% { |
| 110 | @return rgba(#000, color.blackness($color)); | ||
| 111 | } @else { | ||
| 112 | @return rgba(#fff, color.whiteness($color)); | ||
| 113 | } | ||
| 110 | } | 114 | } |
| 111 | 115 | ||
| 112 | @function color-palette($base, $dir: 1) { | 116 | @function color-palette($base, $dir: 1) { |
| @@ -141,7 +145,7 @@ | |||
| 141 | 145 | ||
| 142 | @each $key, $color in $colors { | 146 | @each $key, $color in $colors { |
| 143 | @if $alpha { | 147 | @if $alpha { |
| 144 | $colors: map.set($colors, $key, gray-to-alpha($color)); | 148 | $colors: map.set($colors, $key, gray-to-alpha($lightness, $color)); |
| 145 | } @else { | 149 | } @else { |
| 146 | $colors: map.set($colors, $key, $color); | 150 | $colors: map.set($colors, $key, $color); |
| 147 | } | 151 | } |
