Add static white and black color options to color picker
This commit is contained in:
parent
0879f2aaf0
commit
6c7d3c171e
|
@ -72,6 +72,9 @@
|
||||||
"blue-700",
|
"blue-700",
|
||||||
"indigo-700",
|
"indigo-700",
|
||||||
"magenta-700",
|
"magenta-700",
|
||||||
|
|
||||||
|
"static-white",
|
||||||
|
"static-black",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -101,9 +104,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCheckColor = value => {
|
const getCheckColor = value => {
|
||||||
return /^.*(white|(gray-(50|75|100|200|300|400|500)))\)$/.test(value)
|
// Use dynamic color for theme grays
|
||||||
? "var(--spectrum-global-color-gray-900)"
|
if (value?.includes("gray")) {
|
||||||
: "var(--spectrum-global-color-gray-50)"
|
return /^.*(gray-(50|75|100|200|300|400|500))\)$/.test(value)
|
||||||
|
? "var(--spectrum-global-color-gray-900)"
|
||||||
|
: "var(--spectrum-global-color-gray-50)"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use black check for static white
|
||||||
|
if (value?.includes("static-black")) {
|
||||||
|
return "var(--spectrum-global-color-static-gray-50)"
|
||||||
|
}
|
||||||
|
|
||||||
|
return "var(--spectrum-global-color-static-gray-900)"
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue