diff --git a/packages/core/engine/index.ts b/packages/core/engine/index.ts index 9814590..c409227 100644 --- a/packages/core/engine/index.ts +++ b/packages/core/engine/index.ts @@ -103,7 +103,8 @@ export function umbraHydrate({ isDark: () => isDark(input), format: (formater?: Formater) => format({ output, formater, input }), inverse: () => umbra(inverse(input, inversed)), - apply: ({ alias, formater, target }: ApplyProps) => { + apply: (props?: ApplyProps) => { + const { alias, formater, target } = props || {} const formated = format({ output, formater, input }) return formated.attach({ alias, diff --git a/packages/playground/src/App.vue b/packages/playground/src/App.vue index 632a29a..9c202d5 100644 --- a/packages/playground/src/App.vue +++ b/packages/playground/src/App.vue @@ -49,31 +49,28 @@ const accent3 = { color: '#e5484d' } -// const theme2 = umbra({ -// background: '#000000', -// foreground: '#ffffff', -// accents: [royal, accent, radixRed, radixYellow, radixBlue, accent3, radixRed, success, brown] -// }) - const theme = umbra({ - foreground: '#ffffff', background: '#000000', - accents: ['#ff88ff'], - inversed: { - foreground: '#002200', - background: '#ffffff', - accents: ['#872455'] - } -}).apply({ - alias: true -}) + foreground: '#ffffff', + accents: [royal, accent, radixRed, radixYellow, radixBlue, accent3, radixRed, success, brown] +}).apply({ alias: true }) + +// const theme = umbra({ +// foreground: '#ffffff', +// background: '#000000', +// accents: ['#ff88ff'], +// inversed: { +// foreground: '#002200', +// background: '#ffffff', +// accents: ['#872455'] +// } +// }).apply() const t = ref(theme.input) const formated = ref(theme.formated) function inverse() { - const newTheme = umbra(t.value).inverse().apply({ target: 'body' }) - console.log(t.value.accents[0], newTheme.input) + const newTheme = umbra(t.value).inverse().apply() t.value = newTheme.input }