diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index 039d62577f..b45b1c0261 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -1245,6 +1245,7 @@ pub async fn run_worker = { name: string icon: any documentationLink: string + quickstyle?: Record /** * Dimensions key formula: * [**mobile width**]:[**mobile height**]-[**desktop width**]:[**desktop height**] @@ -2727,19 +2729,25 @@ This is a paragraph. icon: FileBarChart, documentationLink: `${documentationBaseUrl}/statistic_card`, dims: '2:4-3:4' as AppComponentDimensions, + quickstyle: { + title: { + quickCss: ['font-size: 1rem', 'font-size: 1.5rem', 'font-size: 2rem'], + quickTailwindClasses: ['text-xs', 'text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl'] + }, + value: { + quickCss: ['font-size: 1rem', 'font-size: 1.5rem', 'font-size: 2rem'], + quickTailwindClasses: ['text-xs', 'text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl'] + } + } as Record, customCss: { title: { class: '', - style: '', - quickCss: ['font-size: 1rem', 'font-size: 1.5rem', 'font-size: 2rem'], - quickTailwindClasses: ['text-xs', 'text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl'] + style: '' }, container: { class: '', style: '' }, value: { class: '', - style: '', - quickCss: ['font-size: 1rem', 'font-size: 1.5rem', 'font-size: 2rem'], - quickTailwindClasses: ['text-xs', 'text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl'] + style: '' }, media: { class: '', style: '' } }, diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/CssProperty.svelte b/frontend/src/lib/components/apps/editor/componentsPanel/CssProperty.svelte index 5de6011b88..07d986299b 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/CssProperty.svelte +++ b/frontend/src/lib/components/apps/editor/componentsPanel/CssProperty.svelte @@ -167,9 +167,9 @@ /> {/if} - {#if value.quickCss} + {#if componentType && ccomponents?.[componentType]?.quickstyle?.[name]?.quickCss}
- {#each value.quickCss as v} + {#each ccomponents?.[componentType]?.quickstyle?.[name].quickCss ?? [] as v}
- {#if value.quickTailwindClasses} + {#if componentType && ccomponents?.[componentType]?.quickstyle?.[name]?.quickTailwindClasses}
- {#each value.quickTailwindClasses as cls} + {#each ccomponents?.[componentType]?.quickstyle?.[name]?.quickTailwindClasses ?? [] as cls} = Partial<