1
0
Fork 0
mirror of synced 2024-09-18 18:28:33 +12:00

Update CSS conditional UI

This commit is contained in:
Mel O'Hagan 2022-08-22 16:45:59 +01:00
parent 6c6dd76c4c
commit 075611b2fa
2 changed files with 8 additions and 1 deletions

View file

@ -56,7 +56,11 @@
]
let dragDisabled = true
$: settings = getComponentSettings($selectedComponent?._component)
$: settings = getComponentSettings($selectedComponent?._component)?.concat({
label: "CSS",
key: "css",
type: "text",
})
$: settingOptions = settings.map(setting => ({
label: setting.label,
value: setting.key,

View file

@ -379,6 +379,9 @@
// initial props are up to date. By setting it this way rather than
// setting it on initialSettings directly, we avoid a double render.
cachedSettings[key] = allSettings[key]
if (key === "css") {
instance._styles.custom = cachedSettings[key]
}
if (ref?.$$set) {
// Programmatically set the prop to avoid svelte reactive statements