Theming API: Refactor on dt helper
parent
4677385e6d
commit
7ab480303d
|
@ -20,8 +20,8 @@ export const dt = (...args) => {
|
||||||
|
|
||||||
export const dtwt = (theme = {}, tokenPath, fallback, type = 'variable') => {
|
export const dtwt = (theme = {}, tokenPath, fallback, type = 'variable') => {
|
||||||
if (tokenPath) {
|
if (tokenPath) {
|
||||||
const VARIABLE = Theme.defaults.variable;
|
const { variable: VARIABLE, options: OPTIONS } = Theme.defaults || {};
|
||||||
const { prefix, transform } = theme?.options || {};
|
const { prefix, transform } = theme?.options || OPTIONS || {};
|
||||||
const regex = /{([^}]*)}/g;
|
const regex = /{([^}]*)}/g;
|
||||||
const token = SharedUtils.object.test(regex, tokenPath) ? tokenPath : `{${tokenPath}}`;
|
const token = SharedUtils.object.test(regex, tokenPath) ? tokenPath : `{${tokenPath}}`;
|
||||||
const isStrictTransform = type === 'value' || transform === 'strict'; // @todo - TRANSFORM: strict | lenient(default)
|
const isStrictTransform = type === 'value' || transform === 'strict'; // @todo - TRANSFORM: strict | lenient(default)
|
||||||
|
|
Loading…
Reference in New Issue