Skip to content

Commit fe8036f

Browse files
chore: migrate away from deprecated scss lighten/darken
1 parent d2ef9ca commit fe8036f

File tree

11 files changed

+353
-48
lines changed

11 files changed

+353
-48
lines changed

package-lock.json

Lines changed: 318 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/stylesheets/tools/_tools.functions.scss

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,10 @@
88
* TOOLS > FUNCTIONS
99
* **************************************************************************/
1010

11-
@function hex-var($color) {
12-
@return red($color) + ", " + green($color) + ", " + blue($color);
11+
@function lighten-color($color, $percent) {
12+
@return color.adjust($color, $lightness: $percent);
1313
}
1414

15-
@function color-mix-var($base, $color, $percent) {
16-
@return color-mix(in srgb, rgb($color) (100% - $percent), rgb($base));
17-
}
18-
19-
@function lighten-var($color, $percent) {
20-
// Notice: apply a corrective factor to the percent so that it looks almost \
21-
// like SCSS lighten() function.
22-
@return color-mix-var(var(--color-white), $color, ($percent * 1.3));
23-
}
24-
25-
@function darken-var($color, $percent) {
26-
// Notice: apply a corrective factor to the percent so that it looks almost \
27-
// like SCSS darken() function.
28-
@return color-mix-var(var(--color-black), $color, ($percent * 1.3));
15+
@function darken-color($color, $percent) {
16+
@return color.adjust($color, $lightness: -$percent);
2917
}

0 commit comments

Comments
 (0)