Skip to content

pantoken-root / renderers/react-markdown/src / isColorValue

Funkcja: isColorValue() ​

isColorValue(value): boolean

Beta

Prawda, gdy ciąg jest samodzielną wartością koloru CSS (hex lub funkcja koloru).

Parametry ​

value ​

string

Zwraca ​

boolean

Przykład ​

ts
import { isColorValue } from "@pantoken/react-markdown";

isColorValue("#03893D"); // true
isColorValue("oklch(0.7 0.1 200)"); // true
isColorValue("hello"); // false