π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
feat(theme): add liquid glass theme
KeuqS65035966639b
diff --git a/docs/development-guides.md b/docs/development-guides.mdindex 55343bb5..e3bc0372 100644--- a/docs/development-guides.md+++ b/docs/development-guides.md@@ -24,8 +24,7 @@ Choose a snappy name for your theme, and add it to the `builtInThemes` array ins### 2. Write some Styles-Put your theme styles inside [`color-themes.scss`](https://github.com/Lissy93/dashy/blob/master/src/styles/color-themes.scss).-Create a new block, and make sure that `data-theme` matches the theme name you chose above. For example:+Put your theme styles in a dedicated partial under [`src/styles/themes/`](https://github.com/Lissy93/dashy/tree/master/src/styles/themes), import it from [`color-themes.scss`](https://github.com/Lissy93/dashy/blob/master/src/styles/color-themes.scss), and make sure that `data-theme` matches the theme name you chose above. For example:```csshtml[data-theme='tiger'] {diff --git a/docs/theming.md b/docs/theming.mdindex 2f300b0f..c5a851dc 100644--- a/docs/theming.md+++ b/docs/theming.md@@ -1,6 +1,6 @@# Theming-By default Dashy comes with 40+ built-in themes, which can be applied from the dropdown menu in the UI.+By default Dashy comes with 50+ built-in themes, which can be applied from the dropdown menu in the UI.@@ -14,9 +14,27 @@ The following content requires that you have a basic understanding of CSS. If yoThe theme switching is done by simply changing the `data-theme` attribute on the root DOM element, which can then be targeted by CSS. All colors and styles are managed with CSS variables.-The theme switcher in the UI will list all themes defined in [here](github.com/Lissy93/dashy/blob/3.3.1/src/utils/defaults.js#L50), as well as any extras that you add yourself under `appConfig.cssThemes`. Then, when a theme is selected, any CSS within `html[data-theme='my-theme']{}` will be applied.--To apply a default theme to your instance, set `appConfig.theme` (or, use `dayTheme` and `nightTheme` to adjust according to your OS light/dark preferences).+The theme switcher in the UI lists the built-in themes registered in [`src/utils/config/defaults.js`](https://github.com/Lissy93/dashy/blob/master/src/utils/config/defaults.js), as well as any extras that you add under `appConfig.cssThemes`. When a theme is selected, its name is applied to the root `data-theme` attribute and the selection is persisted through Dashy's existing local config storage flow.++To apply a default theme to your instance, set `appConfig.theme` (or, use `dayTheme` and `nightTheme` to adjust according to your OS light/dark preferences).++### Liquid Glass++`liquid-glass` is a built-in glass surface theme that uses the same CSS variable/token system as the other themes. It adds a cool, translucent palette and applies `backdrop-filter` only to bounded chrome surfaces such as the header, settings panel, modals and view switcher. Item cards remain translucent without blur so larger dashboards do not pay the cost of a blur layer for every item.++The theme has several graceful fallbacks:++- Browsers without `backdrop-filter` support receive solid, high-contrast surfaces.+- `prefers-reduced-motion: reduce` disables transitions and hover transforms.+- `forced-colors: active` switches to system colors and removes transparency and blur.+- Touch, narrow, or reduced-data contexts disable blur and reduce shadows.++To use it in `conf.yml`:++```yaml+appConfig:+ theme: liquid-glass+```## Adding Your Own Themediff --git a/src/styles/color-themes.scss b/src/styles/color-themes.scssindex 74d67d22..cc3516c9 100644--- a/src/styles/color-themes.scss+++ b/src/styles/color-themes.scss@@ -35,6 +35,7 @@@import './themes/one-dark';@import './themes/lissy';@import './themes/glass';+@import './themes/liquid-glass';@import './themes/night-bat';@import './themes/cherry-blossom';@import './themes/tama';diff --git a/src/styles/themes/_liquid-glass.scss b/src/styles/themes/_liquid-glass.scssnew file mode 100644index 00000000..aa8fabba--- /dev/null+++ b/src/styles/themes/_liquid-glass.scss@@ -0,0 +1,222 @@+/*+ * Liquid Glass+ *+ * A lightweight glass surface theme. The blur is deliberately restricted to+ * a small set of navigation and modal surfaces; link items stay translucent+ * without backdrop-filter so larger dashboards remain responsive.+ */+html[data-theme='liquid-glass'] {+ --primary: #f1f7ff;+ --foreground: #e8f2ff;+ --background: #091426;+ --background-darker: #06101f;+ --item-group-outer-background: rgba(12, 28, 52, 0.82);+ --item-group-background: rgba(21, 45, 78, 0.58);+ --item-group-heading-text-color: #e8f2ff;+ --item-group-heading-text-color-hover: #ffffff;+ --item-group-shadow: 0 14px 34px rgba(1, 8, 20, 0.28);+ --item-shadow: 0 8px 22px rgba(1, 8, 20, 0.2);+ --item-hover-shadow: 0 12px 28px rgba(1, 8, 20, 0.34);+ --settings-background: rgba(10, 25, 46, 0.82);+ --settings-text-color: #e8f2ff;+ --search-container-background: rgba(10, 25, 46, 0.62);+ --config-settings-background: #0c1b31;+ --cloud-backup-background: #0c1b31;+ --minimal-view-background-color: transparent;+ --minimal-view-group-background: rgba(21, 45, 78, 0.58);+ --minimal-view-section-heading-background: rgba(21, 45, 78, 0.72);+ --minimal-view-section-heading-color: #e8f2ff;+ --curve-factor: 0.9rem;+ --curve-factor-navbar: 1.1rem;+ --liquid-glass-surface: rgba(18, 39, 68, 0.62);+ --liquid-glass-surface-strong: rgba(12, 29, 52, 0.84);+ --liquid-glass-border: rgba(225, 241, 255, 0.22);+ --liquid-glass-highlight: rgba(255, 255, 255, 0.13);+ --liquid-glass-blur: 14px;++ color: var(--foreground);++ body {+ background-color: var(--background);+ background-image:+ radial-gradient(circle at 10% 0%, rgba(86, 179, 255, 0.2), transparent 34rem),+ radial-gradient(circle at 90% 12%, rgba(173, 122, 255, 0.18), transparent 30rem),+ linear-gradient(145deg, #0a1830 0%, #091426 52%, #11102a 100%);+ background-attachment: fixed;+ }++ .home {+ background: transparent;+ }++ .collapsable {+ border: 1px solid var(--liquid-glass-border);+ border-radius: var(--curve-factor);+ background: var(--item-group-outer-background);+ box-shadow: var(--item-group-shadow);+ }++ .collapsable .collapsible-content {+ background: var(--item-group-background);+ }++ .item {+ border: 1px solid transparent;+ border-radius: calc(var(--curve-factor) - 0.15rem);+ background: var(--liquid-glass-surface);+ box-shadow: var(--item-shadow);+ transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;++ &:hover, &:focus {+ border-color: var(--liquid-glass-border);+ background: rgba(47, 83, 128, 0.72);+ box-shadow: var(--item-hover-shadow);+ transform: translateY(-1px);+ }+ }++ .nav-outer nav .nav-item,+ .search-wrap form,+ .search-wrap input,+ .theme-dropdown .vs__dropdown-toggle,+ .display-options svg,+ svg.color-button {+ border: 1px solid var(--liquid-glass-border);+ border-radius: var(--curve-factor);+ background: var(--liquid-glass-surface);+ color: var(--foreground);+ }++ .nav-outer nav .nav-item:hover,+ .nav-outer nav .nav-item:focus,+ .display-options svg:hover,+ .display-options svg.selected,+ svg.color-button:hover,+ svg.color-button.selected {+ background: var(--liquid-glass-highlight);+ border-color: rgba(225, 241, 255, 0.4);+ }++ /* Keep blur to bounded chrome surfaces instead of every card/item. */+ @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {+ header,+ section.settings-outer,+ .options-panel,+ dialog.dashy-modal,+ .theme-configurator-wrapper,+ .view-switcher {+ -webkit-backdrop-filter: blur(var(--liquid-glass-blur)) saturate(125%);+ backdrop-filter: blur(var(--liquid-glass-blur)) saturate(125%);+ background: var(--liquid-glass-surface-strong);+ border: 1px solid var(--liquid-glass-border);+ box-shadow: 0 18px 42px rgba(1, 8, 20, 0.3);+ }+ }++ /* Solid surface fallback for browsers without backdrop-filter support. */+ @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {+ header,+ section.settings-outer,+ .options-panel,+ dialog.dashy-modal,+ .theme-configurator-wrapper,+ .view-switcher {+ background: #122947;+ border: 1px solid #496888;+ box-shadow: 0 12px 28px rgba(1, 8, 20, 0.3);+ }+ }+}++/* Reduce GPU work on touch devices and constrained/reduced-data sessions. */+@media (max-width: 780px), (hover: none), (prefers-reduced-data: reduce) {+ html[data-theme='liquid-glass'] {+ --liquid-glass-blur: 0px;++ body {+ background-attachment: scroll;+ }++ header,+ section.settings-outer,+ .options-panel,+ dialog.dashy-modal,+ .theme-configurator-wrapper,+ .view-switcher {+ -webkit-backdrop-filter: none;+ backdrop-filter: none;+ background: var(--liquid-glass-surface-strong);+ }++ .item {+ box-shadow: 0 4px 12px rgba(1, 8, 20, 0.2);+ transition: none;++ &:hover, &:focus {+ transform: none;+ }+ }+ }+}++@media (prefers-reduced-motion: reduce) {+ html[data-theme='liquid-glass'] {+ body {+ background-attachment: scroll;+ }++ *, *::before, *::after {+ animation-duration: 0.01ms !important;+ animation-iteration-count: 1 !important;+ scroll-behavior: auto !important;+ transition-duration: 0.01ms !important;+ }++ .item:hover, .item:focus {+ transform: none;+ }+ }+}++@media (forced-colors: active) {+ html[data-theme='liquid-glass'] {+ --primary: LinkText;+ --foreground: CanvasText;+ --background: Canvas;+ --background-darker: Canvas;+ --item-group-outer-background: Canvas;+ --item-group-background: Canvas;+ --item-group-heading-text-color: CanvasText;+ --settings-background: Canvas;+ --settings-text-color: CanvasText;++ body {+ background: Canvas;+ color: CanvasText;+ }++ header,+ section.settings-outer,+ .options-panel,+ dialog.dashy-modal,+ .theme-configurator-wrapper,+ .view-switcher,+ .collapsable,+ .item,+ .nav-outer nav .nav-item {+ -webkit-backdrop-filter: none;+ backdrop-filter: none;+ background: Canvas;+ border: 1px solid ButtonText;+ box-shadow: none;+ color: CanvasText;+ }++ .item:hover, .item:focus,+ .nav-outer nav .nav-item:hover,+ .nav-outer nav .nav-item:focus {+ background: Highlight;+ color: HighlightText;+ }+ }+}diff --git a/src/utils/config/ConfigSchema.json b/src/utils/config/ConfigSchema.jsonindex f2285736..b6781c22 100644--- a/src/utils/config/ConfigSchema.json+++ b/src/utils/config/ConfigSchema.json@@ -353,7 +353,8 @@"solarized-light","brutalist","midnight",- "catppuccin"+ "catppuccin",+ "liquid-glass"]},"dayTheme": {diff --git a/src/utils/config/defaults.js b/src/utils/config/defaults.jsindex ec9ce1f5..cdf2345d 100644--- a/src/utils/config/defaults.js+++ b/src/utils/config/defaults.js@@ -89,6 +89,7 @@ const defaults = {'tama','neomorphic','glass-2',+ 'liquid-glass','night-bat','tokyo-night','gruvbox',diff --git a/tests/unit/liquid-glass-theme.test.js b/tests/unit/liquid-glass-theme.test.jsnew file mode 100644index 00000000..da0600b4--- /dev/null+++ b/tests/unit/liquid-glass-theme.test.js@@ -0,0 +1,44 @@+import fs from 'fs';+import path from 'path';+import { builtInThemes } from '@/utils/config/defaults';+import { applyTheme } from '@/utils/Theming';++const themeStylesPath = path.resolve(__dirname, '../../src/styles/themes/_liquid-glass.scss');+const schemaPath = path.resolve(__dirname, '../../src/utils/config/ConfigSchema.json');++describe('Liquid Glass theme registration', () => {+ it('is available to the shared theme picker registration', () => {+ expect(builtInThemes).toContain('liquid-glass');+ });++ it('is available as a config schema theme example', () => {+ const schema = JSON.parse(fs.readFileSync(schemaPath, 'utf8'));+ const examples = schema.properties.appConfig.properties.theme.examples;+ expect(examples).toContain('liquid-glass');+ });++ it('keeps existing glass themes and applies the new theme through the shared path', () => {+ applyTheme('glass-2');+ expect(document.documentElement.dataset.theme).toBe('glass-2');++ applyTheme('liquid-glass');+ expect(document.documentElement.dataset.theme).toBe('liquid-glass');+ });+});++describe('Liquid Glass accessibility and performance fallbacks', () => {+ const styles = fs.readFileSync(themeStylesPath, 'utf8');++ it('uses the token architecture and a bounded backdrop-filter surface list', () => {+ expect(styles).toContain('--primary:');+ expect(styles).toContain('--background:');+ expect(styles).toContain('@supports ((backdrop-filter: blur(1px))');+ expect(styles).toContain('@supports not ((backdrop-filter: blur(1px))');+ });++ it('includes reduced motion, forced colors, and constrained-device fallbacks', () => {+ expect(styles).toContain('@media (prefers-reduced-motion: reduce)');+ expect(styles).toContain('@media (forced-colors: active)');+ expect(styles).toContain('@media (max-width: 780px), (hover: none), (prefers-reduced-data: reduce)');+ });+});