feat: Theme studio v2
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export function toCssStylePropertyName(propertyName: string): string {
|
||||
if (propertyName.startsWith('--')) {
|
||||
return propertyName;
|
||||
}
|
||||
|
||||
return propertyName.replace(/([A-Z])/g, '-$1').toLowerCase();
|
||||
}
|
||||
|
||||
export function applyThemeStyleDeclaration(host: HTMLElement, propertyName: string, value: string): string {
|
||||
const cssPropertyName = toCssStylePropertyName(propertyName);
|
||||
|
||||
host.style.setProperty(cssPropertyName, value);
|
||||
return cssPropertyName;
|
||||
}
|
||||
Reference in New Issue
Block a user