feat: Replace deprecated sass things

- Global built-in functions
- Color functions
This commit is contained in:
sthag 2025-10-25 08:59:09 +02:00
parent 225c1dd55c
commit b739ddefda
13 changed files with 96 additions and 81 deletions

View file

@ -1,13 +1,16 @@
@use "sass:map";
@use "sass:color";
@function createColorMap($color, $percentage, $opacity) {
$map: (
base: $color,
light: lighten($color, $percentage),
dark: darken($color, $percentage),
trans: transparentize($color, $opacity)
light: color.scale($color, $lightness: $percentage),
dark: color.scale($color, $lightness: -$percentage),
trans: color.adjust($color, $alpha: -$opacity)
);
@return $map;
}
@function basic_color($key: 'alpha') {
@return map-get($color_palette, $key);
@return map.get($color_palette, $key);
}

View file

@ -1,4 +1,4 @@
@charset "UTF-8";
@use "sass:color";
// Mixes a color with black.
//
@ -20,5 +20,5 @@
// @return {Color}
@function shade($color, $percent) {
@return mix(#000, $color, $percent);
@return color.mix(#000, $color, $percent);
}

View file

@ -1,4 +1,4 @@
@charset "UTF-8";
@use "sass:color";
// Mixes a color with white.
//
@ -20,5 +20,5 @@
// @return {Color}
@function tint($color, $percent) {
@return mix(#fff, $color, $percent);
@return color.mix(#fff, $color, $percent);
}