feat: Replace deprecated sass things
- Global built-in functions - Color functions
This commit is contained in:
parent
225c1dd55c
commit
b739ddefda
13 changed files with 96 additions and 81 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue