Skip to content

Commit 2e137c4

Browse files
committed
refactor: replace RGBA() with rgba()
1 parent 2f6830d commit 2e137c4

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

scss/helpers/_color-bg.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
@use "../functions/color-contrast" as *;
55
@use "../mixins/color-mode" as *;
66

7-
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251
87
@each $color, $value in $theme-colors {
98
.text-bg-#{$color} {
109
color: color-contrast($value) if($enable-important-utilities, !important, null);
11-
background-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}bg-opacity, 1)) if($enable-important-utilities, !important, null);
10+
background-color: rgba(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}bg-opacity, 1)) if($enable-important-utilities, !important, null);
1211
}
1312
}
1413

@@ -18,7 +17,7 @@
1817
$color-rgb: to-rgb($value);
1918
.text-bg-#{$color} {
2019
color: color-contrast($value) if($enable-important-utilities, !important, null);
21-
background-color: RGBA($color-rgb, var(--#{$prefix}bg-opacity, 1)) if($enable-important-utilities, !important, null);
20+
background-color: rgba($color-rgb, var(--#{$prefix}bg-opacity, 1)) if($enable-important-utilities, !important, null);
2221
}
2322
}
2423
}

scss/helpers/_colored-links.scss

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,32 @@
22
@use "../functions/color" as *;
33
@use "../functions/color-contrast" as *;
44

5-
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251
65
@each $color, $value in $theme-colors {
76
.link-#{$color} {
8-
color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
9-
text-decoration-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
7+
color: rgba(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
8+
text-decoration-color: rgba(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
109

1110
@if $link-shade-percentage != 0 {
1211
&:hover,
1312
&:focus {
1413
$hover-color: if(color-contrast($value) == $color-contrast-light, shade-color($value, $link-shade-percentage), tint-color($value, $link-shade-percentage));
15-
color: RGBA(#{to-rgb($hover-color)}, var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
16-
text-decoration-color: RGBA(to-rgb($hover-color), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
14+
color: rgba(#{to-rgb($hover-color)}, var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
15+
text-decoration-color: rgba(to-rgb($hover-color), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
1716
}
1817
}
1918
}
2019
}
2120

2221
// One-off special link helper as a bridge until v6
2322
.link-body-emphasis {
24-
color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
25-
text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
23+
color: rgba(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
24+
text-decoration-color: rgba(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
2625

2726
@if $link-shade-percentage != 0 {
2827
&:hover,
2928
&:focus {
30-
color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, .75)) if($enable-important-utilities, !important, null);
31-
text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, .75)) if($enable-important-utilities, !important, null);
29+
color: rgba(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, .75)) if($enable-important-utilities, !important, null);
30+
text-decoration-color: rgba(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, .75)) if($enable-important-utilities, !important, null);
3231
}
3332
}
3433
}

0 commit comments

Comments
 (0)