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 7ed95d9 commit 9c46dcbCopy full SHA for 9c46dcb
1 file changed
frontend/util/color-validator.ts
@@ -3,16 +3,10 @@ const FunctionalColorRegex = /^([a-z-]+)\(/i;
3
const NamedColorRegex = /^[a-z]+$/i;
4
5
function isValidCssColor(color: string): boolean {
6
- if (typeof CSS != "undefined" && typeof CSS.supports == "function") {
7
- return CSS.supports("color", color);
8
- }
9
- if (typeof document == "undefined") {
+ if (typeof CSS == "undefined" || typeof CSS.supports != "function") {
10
return false;
11
}
12
- const temp = document.createElement("div");
13
- temp.style.color = "";
14
- temp.style.color = color;
15
- return temp.style.color != "";
+ return CSS.supports("color", color);
16
17
18
function getCssColorType(color: string): string {
0 commit comments