-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deep watcher for
config.theme
and Improve designer
- Loading branch information
1 parent
a0e2a60
commit cfa9435
Showing
5 changed files
with
237 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
apps/showcase/components/layout/designer/DesignColorPalette.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
<template> | ||
<div class="flex border border-surface rounded-l-lg rounded-r-lg overflow-hidden"> | ||
<div v-for="color of value" :key="color" class="w-8 h-8" :style="{ backgroundColor: color }" :title="color"></div> | ||
<div v-for="(color, i) of value" :key="i + '_' + color" class="w-8 h-8" :style="getStyle(color)" :title="color"></div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { isObject } from '@primeuix/utils'; | ||
import { $dt } from '@primevue/themes'; | ||
export default { | ||
props: { | ||
value: { | ||
type: Object, | ||
default: null | ||
} | ||
}, | ||
methods: { | ||
getStyle(color) { | ||
const colorScheme = this.$appState.darkTheme ? 'light' : 'dark'; | ||
const token = color?.replace(/{|}/g, ''); | ||
const tokenValue = $dt(token)?.value; | ||
const backgroundColor = (isObject(tokenValue) ? tokenValue[colorScheme]?.value : tokenValue) ?? color; | ||
return { backgroundColor }; | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters