mirror of
https://github.com/documenso/documenso.git
synced 2025-11-20 11:41:44 +10:00
fix: use khebab case
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
import { colord } from 'colord';
|
import { colord } from 'colord';
|
||||||
|
import { toKebabCase } from 'remeda';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export const ZCssVarsSchema = z
|
export const ZCssVarsSchema = z
|
||||||
@ -46,9 +47,7 @@ export const toNativeCssVars = (vars: TCssVarsSchema) => {
|
|||||||
const color = colord(value);
|
const color = colord(value);
|
||||||
const { h, s, l } = color.toHsl();
|
const { h, s, l } = color.toHsl();
|
||||||
|
|
||||||
// Convert camelCase to kebab-case (e.g., mutedForeground -> muted-foreground)
|
cssVars[`--${toKebabCase(key)}`] = `${h} ${s} ${l}`;
|
||||||
const kebabKey = key.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
||||||
cssVars[`--${kebabKey}`] = `${h} ${s} ${l}`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user