1
0
Fork 0
mirror of synced 2024-10-03 02:27:06 +13:00

Update CSS conditional UI

This commit is contained in:
Mel O'Hagan 2022-08-22 16:45:59 +01:00
parent fe3d9f40f6
commit 3b78d4773b
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