We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4f9b60 commit d9ff3daCopy full SHA for d9ff3da
.changeset/little-hats-sleep.md
@@ -0,0 +1,5 @@
1
+---
2
+'@compai/css-gui': patch
3
4
+
5
+Properly handle contrast for all properties
packages/gui/src/lib/color.ts
@@ -23,10 +23,19 @@ const getColorToContrastWith = (
23
ruleset: Record<string, any>,
24
theme?: any
25
) => {
26
- const valueOrPath = ruleset[CONTRAST_PROPERTY_MAP[property]]
+ const contrastProperty = CONTRAST_PROPERTY_MAP[property]
27
+ if (!contrastProperty) {
28
+ return null
29
+ }
30
31
+ const valueOrPath = ruleset[contrastProperty]
32
+ if (!valueOrPath) {
33
34
35
36
return themeGet({
37
theme,
- path: valueOrPath.path || valueOrPath,
38
+ path: valueOrPath?.path || valueOrPath,
39
property: 'color',
40
})
41
}
0 commit comments