MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / chartCssVariableName

Function chartCssVariableName

packages/react/src/components/chart.tsx:32–33  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

30 /^(?:#[0-9A-Fa-f]{3,8}|(?:rgb|hsl)a?\(\s*[-+0-9.%]+\s*(?:,\s*[-+0-9.%]+\s*){2}(?:,\s*[-+0-9.]+\s*)?\)|(?:rgb|hsl)a?\(\s*[-+0-9.%]+\s+[-+0-9.%]+\s+[-+0-9.%]+(?:\s*\/\s*[-+0-9.%]+)?\s*\)|[A-Za-z]+|var\(--[A-Za-z0-9_-]+\))$/;
31
32export const chartCssVariableName = (key: string): string | null =>
33 cssIdentifierPattern.test(key) ? `--color-${key}` : null;
34
35export const chartCssColorValue = (color: string): string | null => {
36 const trimmed = color.trim();

Callers 2

chart.test.tsFile · 0.90
ChartStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected