Skip to content

pantoken / renderers/react-markdown/src / isColorValue

Fonction: isColorValue()

isColorValue(value): boolean

Bêta

Vrai lorsqu'une chaîne est une valeur de couleur CSS autonome (hex ou une fonction de couleur).

Paramètres

value

string

Retourne

boolean

Exemple

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

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