Skip to content

Commit eb1965a

Browse files
committed
refactor: update global built-in functions
1 parent 1377e51 commit eb1965a

File tree

7 files changed

+36
-31
lines changed

7 files changed

+36
-31
lines changed

scss/_range-slider.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "sass:string";
12
@use "mixins/border-radius" as *;
23
@use "mixins/box-shadow" as *;
34
@use "mixins/gradients" as *;
@@ -67,7 +68,7 @@
6768
position: relative;
6869
display: flex;
6970
align-items: center;
70-
height: unquote("max(var(--#{$prefix}range-slider-thumb-height), var(--#{$prefix}range-slider-track-height))");
71+
height: string.unquote("max(var(--#{$prefix}range-slider-thumb-height), var(--#{$prefix}range-slider-track-height))");
7172
}
7273

7374
.range-slider-track {
@@ -243,7 +244,7 @@
243244

244245
.range-slider-inputs-container {
245246
justify-content: center;
246-
width: unquote("max(var(--#{$prefix}range-slider-thumb-width), var(--#{$prefix}range-slider-vertical-track-width))");
247+
width: string.unquote("max(var(--#{$prefix}range-slider-thumb-width), var(--#{$prefix}range-slider-vertical-track-width))");
247248
height: 100%;
248249
}
249250

scss/_root.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "sass:map";
12
@use "sass:meta";
23
@use "functions/color" as *;
34
@use "functions/to-rgb" as *;
@@ -47,8 +48,8 @@
4748
--#{$prefix}black-rgb: #{to-rgb($black)};
4849

4950
@each $color, $value in $theme-gradients {
50-
--#{$prefix}#{$color}-start: #{map-get($value, "start")};
51-
--#{$prefix}#{$color}-stop: #{map-get($value, "stop")};
51+
--#{$prefix}#{$color}-start: #{map.get($value, "start")};
52+
--#{$prefix}#{$color}-stop: #{map.get($value, "stop")};
5253
}
5354

5455
// Fonts
@@ -224,8 +225,8 @@
224225
}
225226

226227
@each $color, $value in $theme-gradients-dark {
227-
--#{$prefix}#{$color}-start: #{map-get($value, "start")};
228-
--#{$prefix}#{$color}-stop: #{map-get($value, "stop")};
228+
--#{$prefix}#{$color}-start: #{map.get($value, "start")};
229+
--#{$prefix}#{$color}-stop: #{map.get($value, "stop")};
229230
}
230231

231232
--#{$prefix}heading-color: #{$headings-color-dark};

scss/_variables-dark.scss

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,43 +106,43 @@ $dark-border-subtle-dark: $gray-800-dark !default;
106106

107107
// scss-docs-start theme-gradients-dark-variables
108108
$primary-gradient-dark: (
109-
"start": desaturate(#5856d6, 10%),
110-
"stop": desaturate(#6f67db, 10%)
109+
"start": color.scale(#5856d6, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
110+
"stop": color.scale(#6f67db, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
111111
) !default;
112112

113113
$secondary-gradient-dark: (
114-
"start": desaturate(#c8d2dc, 10%),
115-
"stop": desaturate($white, 10%)
114+
"start": color.scale(#c8d2dc, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
115+
"stop": color.scale($white, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
116116
) !default;
117117

118118
$light-gradient-dark: (
119-
"start": desaturate(#e3e8ed, 10%),
120-
"stop": desaturate($white, 10%)
119+
"start": color.scale(#e3e8ed, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
120+
"stop": color.scale($white, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
121121
) !default;
122122

123123
$dark-gradient-dark: (
124-
"start": desaturate(#3c4b64, 10%),
125-
"stop": desaturate(#212333, 10%)
124+
"start": color.scale(#3c4b64, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
125+
"stop": color.scale(#212333, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
126126
) !default;
127127

128128
$danger-gradient-dark: (
129-
"start": desaturate(#e55353, 10%),
130-
"stop": desaturate(#d93737, 10%)
129+
"start": color.scale(#e55353, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
130+
"stop": color.scale(#d93737, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
131131
) !default;
132132

133133
$warning-gradient-dark: (
134-
"start": desaturate(#f9b115, 10%),
135-
"stop": desaturate(#f6960b, 10%)
134+
"start": color.scale(#f9b115, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
135+
"stop": color.scale(#f6960b, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
136136
) !default;
137137

138138
$success-gradient-dark: (
139-
"start": desaturate(#2eb85c, 10%),
140-
"stop": desaturate(#1b9e3e, 10%)
139+
"start": color.scale(#2eb85c, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
140+
"stop": color.scale(#1b9e3e, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
141141
) !default;
142142

143143
$info-gradient-dark: (
144-
"start": desaturate(#39f, 10%),
145-
"stop": desaturate(#2982cc, 10%)
144+
"start": color.scale(#39f, $saturation: -10%), // stylelint-disable-line scss/at-function-named-arguments
145+
"stop": color.scale(#2982cc, $saturation: -10%) // stylelint-disable-line scss/at-function-named-arguments
146146
) !default;
147147

148148
$theme-gradients-dark: (

scss/_variables.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,12 @@ $position-values: (
523523
$elevation-base-color: 60, 75, 100 !default;
524524

525525
$elevations: (
526-
0: unquote("none"),
527-
1: unquote("0 1px 1px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 2px 1px -1px rgba(var(--#{$prefix}elevation-base-color), .12), 0 1px 3px 0 rgba(var(--#{$prefix}elevation-base-color), .20)"),
528-
2: unquote("0 2px 2px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 1px -2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 1px 5px 0 rgba(var(--#{$prefix}elevation-base-color), .20)"),
529-
3: unquote("0 6px 10px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 1px 18px 0 rgba(var(--#{$prefix}elevation-base-color), .12), 0 3px 5px -1px rgba(var(--#{$prefix}elevation-base-color), .20)"),
530-
4: unquote("0 8px 10px 1px rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 14px 2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 5px 5px -3px rgba(var(--#{$prefix}elevation-base-color), .20)"),
531-
5: unquote("0 12px 17px 2px rgba(var(--#{$prefix}elevation-base-color), .14), 0 5px 22px 4px rgba(var(--#{$prefix}elevation-base-color), .12), 0 7px 8px -4px rgba(var(--#{$prefix}elevation-base-color), .20)"),
526+
0: string.unquote("none"),
527+
1: string.unquote("0 1px 1px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 2px 1px -1px rgba(var(--#{$prefix}elevation-base-color), .12), 0 1px 3px 0 rgba(var(--#{$prefix}elevation-base-color), .20)"),
528+
2: string.unquote("0 2px 2px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 1px -2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 1px 5px 0 rgba(var(--#{$prefix}elevation-base-color), .20)"),
529+
3: string.unquote("0 6px 10px 0 rgba(var(--#{$prefix}elevation-base-color), .14), 0 1px 18px 0 rgba(var(--#{$prefix}elevation-base-color), .12), 0 3px 5px -1px rgba(var(--#{$prefix}elevation-base-color), .20)"),
530+
4: string.unquote("0 8px 10px 1px rgba(var(--#{$prefix}elevation-base-color), .14), 0 3px 14px 2px rgba(var(--#{$prefix}elevation-base-color), .12), 0 5px 5px -3px rgba(var(--#{$prefix}elevation-base-color), .20)"),
531+
5: string.unquote("0 12px 17px 2px rgba(var(--#{$prefix}elevation-base-color), .14), 0 5px 22px 4px rgba(var(--#{$prefix}elevation-base-color), .12), 0 7px 8px -4px rgba(var(--#{$prefix}elevation-base-color), .20)"),
532532
) !default;
533533

534534
// Body

scss/forms/_form-multi-select.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "../functions/escape-svg" as *;
12
@use "../mixins/border-radius" as *;
23
@use "../mixins/box-shadow" as *;
34
@use "../mixins/elevation" as *;

scss/helpers/_color-bg.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "sass:map";
12
@use "../functions/color" as *;
23
@use "../functions/color-contrast" as *;
34
@use "../functions/to-rgb" as *;
@@ -14,7 +15,7 @@
1415

1516
@each $color, $value in $theme-gradients {
1617
.text-bg-#{$color}-gradient {
17-
color: color-contrast(map-get($value, "start")) if($enable-important-utilities, !important, null);
18+
color: color-contrast(map.get($value, "start")) if($enable-important-utilities, !important, null);
1819
background-color: var(--#{$prefix}#{$color});
1920
background-image: linear-gradient(45deg, var(--#{$prefix}#{$color}-start) 0%, var(--#{$prefix}#{$color}-stop) 100%);
2021
}
@@ -32,7 +33,7 @@
3233

3334
@each $color, $value in $theme-gradients-dark {
3435
.text-bg-#{$color}-gradient {
35-
color: color-contrast(map-get($value, "start")) if($enable-important-utilities, !important, null);
36+
color: color-contrast(map.get($value, "start")) if($enable-important-utilities, !important, null);
3637
}
3738
}
3839
}

scss/mixins/_elevation.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
@use "sass:map";
12
@use "../variables" as *;
23

34
@mixin elevation($value, $exclude: null) {
45
@if $enable-elevations {
5-
box-shadow: map-get($elevations, $value);
6+
box-shadow: map.get($elevations, $value);
67

78
@if $enable-dark-mode {
89
[data-coreui-theme]:not([data-coreui-theme="dark"]) & {

0 commit comments

Comments
 (0)