@claspo/common 6.0.4-theme.21 → 6.0.4-theme.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/theme/theme.utils.d.ts +1 -0
- package/theme/theme.utils.js +1 -1
package/package.json
CHANGED
package/theme/theme.utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ThemeI } from "../document/Document.interface";
|
|
2
2
|
export declare const THEME_CSS_VAR_PREFIX = "cl-schema-";
|
|
3
3
|
export declare function toCssVarToken(token: string): string;
|
|
4
|
+
export declare function formCssVarToSchemaToken(cssVar?: string): string;
|
|
4
5
|
export declare function createTheme(schema?: Record<string, string>): ThemeI;
|
package/theme/theme.utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DefaultSchemaTokens}from"../document/Document.interface";export const THEME_CSS_VAR_PREFIX="cl-schema-";export function toCssVarToken(e){return`cl-schema-${e}`}export function createTheme(e={}){return 0===Object.keys(e).length&&(e={[DefaultSchemaTokens.ACCENT]:"#000000"}),{schema:Object.assign({},e)}}
|
|
1
|
+
import{DefaultSchemaTokens}from"../document/Document.interface";export const THEME_CSS_VAR_PREFIX="cl-schema-";export function toCssVarToken(e){return`cl-schema-${e}`}export function formCssVarToSchemaToken(e=""){return e.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}export function createTheme(e={}){return 0===Object.keys(e).length&&(e={[DefaultSchemaTokens.ACCENT]:"#000000"}),{schema:Object.assign({},e)}}
|