Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
CarelessCourage committed Jan 8, 2024
1 parent c41d45f commit 47a0235
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
3 changes: 2 additions & 1 deletion packages/core/engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
33 changes: 15 additions & 18 deletions packages/playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 47a0235

Please sign in to comment.