Compare commits

..

No commits in common. "ca57af0a43134cdb550e98ed00e8959da17e6e8e" and "a023c44beef6e655d58ee6de7d2df6aac5211b05" have entirely different histories.

4 changed files with 4 additions and 18 deletions

View file

@ -523,7 +523,7 @@ export default {
})
exports.computeColor = (color) => {
const computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: staticVars.value })
const computedColor = findColor(color, { dynamicVars: dynamicVars.value, staticVars: selectedPalette.value })
if (computedColor) {
return rgb2hex(computedColor)
}
@ -720,20 +720,6 @@ export default {
return previewRules.value[0].dynamicVars
})
const staticVars = computed(() => {
const rootComponent = overallPreviewRules.value.find(r => {
return r.component === 'Root'
})
const rootDirectivesEntries = Object.entries(rootComponent.directives)
const directives = Object.fromEntries(
rootDirectivesEntries
.filter(([k, v]) => k.startsWith('--') && v.startsWith('color | '))
.map(([k, v]) => [k.substring(2), v.substring('color | '.length)]))
return directives
})
provide('staticVars', staticVars)
exports.staticVars = staticVars
const previewColors = computed(() => {
const stacked = dynamicVars.value.stacked
const background = typeof stacked === 'string' ? stacked : rgb2hex(stacked)

View file

@ -303,7 +303,7 @@
:disabled="!isShadowPresent"
:no-preview="true"
:compact="true"
:static-vars="staticVars"
:static-vars="selectedPalette"
@subShadowSelected="onSubShadow"
/>
</div>

View file

@ -26,7 +26,7 @@ export default {
exports.emit = emit
exports.computeColor = inject('computeColor')
exports.staticVars = inject('staticVars')
exports.selectedPalette = inject('selectedPalette')
const selectedVirtualDirectiveId = ref(0)
exports.selectedVirtualDirectiveId = selectedVirtualDirectiveId

View file

@ -68,7 +68,7 @@
<ShadowControl
v-if="selectedVirtualDirectiveValType === 'shadow'"
v-model="draftVirtualDirective"
:static-vars="staticVars"
:static-vars="selectedPalette"
:compact="true"
/>
<ColorInput