Files
windmill/frontend/src/lib/components/apps/editor/componentsPanel/ThemeCodePreview.svelte
Faton Ramadani c19757af1b feat(frontend): Global CSS editor (#2178)
* feat(frontend): add global css

* feat(frontend): working styling

* feat(frontend): Add default classes

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* feat(frontend): Add global css v0

* feat(frontend): Add global css v0

* add css workers

* fix(frontend): Fix overflow issue

* wip

* feat(frontend): check for EE before injecting global css

* wip

* wip

* wip

* fix(frontend): fix typing issues

* fix(frontend): fix typing issues

* fix(frontend): fix global css

* fix(frontend): add missing mapping

* fix(frontend): Fix how styles are loaded

* fix(frontend): fix preview

* feat(frontend): fix everything

* feat(frontend): fix class autocomplete

* feat(frontend): remove console.log

* feat(frontend): update tooltup

* feat(frontend): eval

* feat(frontend): eval

* feat(frontend): fix build

* feat(frontend): fix initial binding

* feat(frontend): wip

* wip

* feat(frontend): Finish theme v0

* feat(frontend): Fix resource page

* feat(frontend): fix build

* feat(frontend): theme UI

* feat(frontend): theme UI

* feat(frontend): theme UI

* feat(frontend): fix EE

* feat(frontend): add missing warning

* feat(frontend): fix preview

* feat(frontend): fix global css by component initialisation

* feat(frontend): remove unused libraries

* feat(frontend): fix EE check

* feat(frontend): fix EE check

* feat(frontend): fix preview

* feat(frontend): Fix migration

* feat(frontend): Fix issues

* feat(frontend): add missing disabled in migration modal

* feat(frontend): Fix preview

* feat(frontend): Fix preview

* all

* all

* all

* sqlx

---------

Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
2023-09-15 22:55:47 +02:00

35 lines
908 B
Svelte

<script lang="ts">
import type { AppTheme } from '../../types'
import { resolveTheme } from './themeUtils'
import { workspaceStore } from '$lib/stores'
import { onMount } from 'svelte'
import SimpleEditor from '$lib/components/SimpleEditor.svelte'
export let theme: AppTheme | undefined = undefined
let code: string | undefined = undefined
let cssEditor: SimpleEditor | undefined = undefined
onMount(async () => {
code = await resolveTheme(theme, $workspaceStore)
cssEditor?.setCode(code)
})
</script>
<div class="relative h-full">
<div class="absolute z-[100] left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%]">
<slot />
</div>
<div class="absolute top-0 left-0 right-0 bottom-0 bg-gray-100 bg-opacity-50 z-50" />
<SimpleEditor
class="h-full"
lang="css"
{code}
fixedOverflowWidgets={false}
small
automaticLayout
bind:this={cssEditor}
deno={false}
/>
</div>