refactor: replace deprecated global functions to fix Sass warnings

This commit is contained in:
Lucas Larroche 2025-03-15 12:03:28 +07:00
parent 0a77e6f335
commit 537e3aedc2
9 changed files with 65 additions and 39 deletions

View file

@ -1,3 +1,4 @@
@use "sass:list";
@use "sass:map";
@use "../../colors";
@use "settings";
@ -30,7 +31,7 @@ $css-var-color-prefix: #{settings.$css-var-prefix}#{$color-property-name};
@if map.get(settings.$utilities, "background-colors") {
// Loop through color families
@each $family, $colors in colors.$colors {
@if index(map.get(settings.$palette, "color-families"), $family) {
@if list.index(map.get(settings.$palette, "color-families"), $family) {
$css-var-family-name: #{$css-var-color-prefix}-#{$family};
$class-family-name: #{$background-color-property-name}-#{$family};
@ -52,7 +53,7 @@ $css-var-color-prefix: #{settings.$css-var-prefix}#{$color-property-name};
// Shades
@else if
index(map.get(settings.$palette, "shades"), $shade) and
list.index(map.get(settings.$palette, "shades"), $shade) and
map.get(settings.$palette, "enable-shades")
{
$value: $color-value;

View file

@ -1,3 +1,4 @@
@use "sass:list";
@use "sass:map";
@use "../../colors";
@use "settings";
@ -11,7 +12,7 @@
// Loop through color families
@each $family, $colors in colors.$colors {
@if index(map.get(settings.$palette, "color-families"), $family) {
@if list.index(map.get(settings.$palette, "color-families"), $family) {
$css-var-family-name: #{$css-var-color-prefix}-#{$family};
$class-family-name: #{$color-property-name}-#{$family};
@ -31,7 +32,7 @@
// Shades
@else if
index(map.get(settings.$palette, "shades"), $shade) and
list.index(map.get(settings.$palette, "shades"), $shade) and
map.get(settings.$palette, "enable-shades")
{
@if $enable-css-vars {

View file

@ -1,3 +1,4 @@
@use "sass:list";
@use "sass:map";
@use "../../colors";
@use "settings";
@ -13,7 +14,7 @@
:host {
// Loop through color families
@each $family, $colors in colors.$colors {
@if index(map.get(settings.$palette, "color-families"), $family) {
@if list.index(map.get(settings.$palette, "color-families"), $family) {
$css-var-family-name: #{$css-var-color-prefix}-#{$family};
// Loop through colors
@ -25,7 +26,7 @@
// Shades
@else if
index(map.get(settings.$palette, "shades"), $shade) and
list.index(map.get(settings.$palette, "shades"), $shade) and
map.get(settings.$palette, "enable-shades")
{
#{$css-var-family-name}-#{$shade}: #{utils.display-color($color-value)};