Skip to content

Commit 2b82d7a

Browse files
committed
refactor: update color handling in SCSS to use sd for hex values
1 parent 31c7947 commit 2b82d7a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/lib/sage-frontend/stylesheets/docs/_colors.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
}
4444

4545
// build individual color blocks
46+
// Use sd-sage-color() directly for hex values (works with published npm version)
4647
/* stylelint-disable max-nesting-depth */
4748
@each $name, $color in $sage-colors {
4849
@each $value, $map in $color {
49-
// Use sage-color-hex() for actual hex values (needed for color documentation display)
50-
// This ensures colors are displayed correctly regardless of dark/light mode
51-
$hex: sage-color-hex($name, $value);
50+
// Get hex value directly from Style Dictionary
51+
$hex: sd-sage-color($name, $value, hex);
5252

5353
// Determine class name for $value == 50
5454
$classname: ".color-#{"" + $name}-#{$value}";
@@ -65,10 +65,10 @@
6565

6666
// Simple lightness-based contrast: white text on dark, black text on light
6767
@if (lightness($hex) < 55%) {
68-
color: sage-color-hex(white);
68+
color: #fff;
6969
}
7070
@else {
71-
color: sage-color-hex(grey, 950);
71+
color: sd-sage-color(grey, 950, hex);
7272
}
7373

7474
&::after {
@@ -88,10 +88,10 @@
8888

8989
.color-white-100 {
9090
border-radius: sage-border(radius);
91-
border: 1px solid sage-color-hex(grey, 300);
92-
box-shadow: inset 0 0 0.0625rem sage-color-hex(grey, 300);
91+
border: 1px solid sd-sage-color(grey, 300, hex);
92+
box-shadow: inset 0 0 0.0625rem sd-sage-color(grey, 300, hex);
9393
}
9494

9595
.color-black-100 {
96-
color: sage-color-hex(white);
96+
color: #fff;
9797
}

0 commit comments

Comments
 (0)