diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-01 19:53:28 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-01 19:53:28 +1100 |
| commit | 27b12681f61188d458560480e74d377c141fff52 (patch) | |
| tree | b10ecf5f0f8565322dae651ee7845801377385ef /app.tsx | |
| parent | calendar: cache calendars (diff) | |
| download | caelestia-shell-27b12681f61188d458560480e74d377c141fff52.tar.gz caelestia-shell-27b12681f61188d458560480e74d377c141fff52.tar.bz2 caelestia-shell-27b12681f61188d458560480e74d377c141fff52.zip | |
feat: toggle borders option
Diffstat (limited to 'app.tsx')
| -rw-r--r-- | app.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -28,6 +28,13 @@ const applyTransparency = (name: string, hex: string) => { const applyVibrancy = (hex: string) => (style.vibrant.get() ? `color.scale(${hex}, $saturation: 40%)` : hex); +const getVars = () => { + const vars = { light: Palette.get_default().mode === "light", borders: style.borders.get() }; + return Object.entries(vars) + .map(([k, v]) => `$${k}: ${v}`) + .join(";"); +}; + const styleLoader = new (class { #running = false; #dirty = false; @@ -47,10 +54,7 @@ const styleLoader = new (class { const schemeColours = Object.entries(Palette.get_default().colours) .map(([name, hex]) => `$${name}: ${applyVibrancy(applyTransparency(name, hex))};`) .join("\n"); - await writeFileAsync( - `${SRC}/scss/scheme/_index.scss`, - `@use "sass:color";\n$light: ${Palette.get_default().mode === "light"};\n${schemeColours}` - ); + await writeFileAsync(`${SRC}/scss/scheme/_index.scss`, `@use "sass:color";\n${getVars()};\n${schemeColours}`); App.apply_css(await execAsync(`sass ${SRC}/style.scss`), true); } })(); @@ -66,7 +70,6 @@ App.start({ await initConfig(); loadStyleAsync().catch(console.error); - style.transparency.subscribe(() => loadStyleAsync().catch(console.error)); Palette.get_default().connect("notify::colours", () => loadStyleAsync().catch(console.error)); Palette.get_default().connect("notify::mode", () => loadStyleAsync().catch(console.error)); |