@molecule/app-theme-css-variables-liquid-glass 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +168 -0
  2. package/package.json +7 -6
package/README.md ADDED
@@ -0,0 +1,168 @@
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-09-13T23:39:58.968Z
7
+ -->
8
+
9
+ # @molecule/app-theme-css-variables-liquid-glass
10
+
11
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
12
+ > It is written to be read by coding agents as much as by people, and is generated from this
13
+ > package's source — edit `src/index.ts` JSDoc, not this file.
14
+
15
+ Liquid glass theme preset for molecule.dev.
16
+
17
+ Provides translucent, frosted-glass-inspired light and dark themes
18
+ designed to pair with backdrop-filter blur effects. Uses the standard
19
+ CSS custom properties provider from `@molecule/app-theme-css-variables`.
20
+
21
+ ## Quick Start
22
+
23
+ ```typescript
24
+ import {
25
+ createCSSVariablesThemeProvider,
26
+ lightTheme,
27
+ darkTheme,
28
+ } from '@molecule/app-theme-css-variables-liquid-glass'
29
+ import { setProvider } from '@molecule/app-theme'
30
+
31
+ const provider = createCSSVariablesThemeProvider({
32
+ themes: [lightTheme, darkTheme],
33
+ defaultTheme: 'dark',
34
+ persistKey: 'molecule-theme',
35
+ })
36
+
37
+ setProvider(provider)
38
+ ```
39
+
40
+ ## Type
41
+
42
+ `provider`
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ npm install @molecule/app-theme-css-variables-liquid-glass @molecule/app-theme @molecule/app-theme-css-variables
48
+ ```
49
+
50
+ ## API
51
+
52
+ ### Interfaces
53
+
54
+ #### `CSSVariablesThemeConfig`
55
+
56
+ Configuration for css variables theme.
57
+
58
+ ```typescript
59
+ interface CSSVariablesThemeConfig {
60
+ /** Available themes. */
61
+ themes: Theme[]
62
+ /** Name of the default theme to use. */
63
+ defaultTheme?: string
64
+ /** CSS variable prefix (default: 'mol'). */
65
+ prefix?: string
66
+ /** Whether to auto-apply CSS variables to :root (default: true). */
67
+ applyToDocument?: boolean
68
+ /**
69
+ * Key for persisting the selected theme name across reloads. When `storage`
70
+ * is omitted, persistence falls back to `window.localStorage` in browser
71
+ * environments; in SSR / non-browser environments persistence is skipped.
72
+ */
73
+ persistKey?: string
74
+ /**
75
+ * Storage adapter for persisting theme preference. Optional — when omitted
76
+ * and `persistKey` is set, `window.localStorage` is used when available.
77
+ * Provide an adapter for React Native (AsyncStorage wrapper) or custom stores.
78
+ */
79
+ storage?: ThemeStorageAdapter
80
+ /**
81
+ * With no persisted choice, start on the theme whose `mode` matches the
82
+ * OS preference (`prefers-color-scheme`) instead of `defaultTheme`.
83
+ * Browser-only: a render without a window — a server, a build-time
84
+ * prerender — starts on `defaultTheme`, which `getServerTheme()` reports
85
+ * so a hydrating client renders the markup it was sent before switching.
86
+ * Default: false.
87
+ */
88
+ systemDefault?: boolean
89
+ }
90
+ ```
91
+
92
+ #### `ThemeStorageAdapter`
93
+
94
+ Minimal storage adapter for theme persistence. Compatible with
95
+ localStorage, sessionStorage, or any custom implementation
96
+ (e.g., React Native AsyncStorage wrapper, SSR no-op).
97
+
98
+ ```typescript
99
+ interface ThemeStorageAdapter {
100
+ getItem(key: string): string | null
101
+ setItem(key: string, value: string): void
102
+ }
103
+ ```
104
+
105
+ ### Functions
106
+
107
+ #### `createCSSVariablesThemeProvider(config)`
108
+
109
+ Creates a framework-agnostic ThemeProvider that applies theme tokens
110
+ as CSS custom properties on the document root element.
111
+
112
+ ```typescript
113
+ function createCSSVariablesThemeProvider(config: CSSVariablesThemeConfig): ThemeProvider
114
+ ```
115
+
116
+ - `config` — Theme provider configuration (available themes, default theme, CSS variable prefix, persistence).
117
+
118
+ **Returns:** A ThemeProvider that applies themes as CSS custom properties on the document root.
119
+
120
+ ### Constants
121
+
122
+ #### `darkTheme`
123
+
124
+ Liquid glass dark theme.
125
+
126
+ Translucent dark surfaces over blurred backgrounds.
127
+
128
+ ```typescript
129
+ const darkTheme: Theme
130
+ ```
131
+
132
+ #### `lightTheme`
133
+
134
+ Liquid glass light theme.
135
+
136
+ Translucent white surfaces over blurred backgrounds.
137
+
138
+ ```typescript
139
+ const lightTheme: Theme
140
+ ```
141
+
142
+ ## Core Interface
143
+
144
+ Implements `@molecule/app-theme` interface.
145
+
146
+ ## Injection Notes
147
+
148
+ ### Requirements
149
+
150
+ Peer dependencies:
151
+
152
+ - `@molecule/app-theme` ^1.0.1
153
+ - `@molecule/app-theme-css-variables` ^1.0.1
154
+
155
+ ### Runtime Dependencies
156
+
157
+ - `@molecule/app-theme`
158
+ - `@molecule/app-theme-css-variables`
159
+
160
+ - The frosted BLUR comes from the ClassMap, not from these themes: pair with
161
+ `@molecule/app-ui-tailwind-glass` (`setClassMap(classMap)`), which layers
162
+ `backdrop-filter` onto surface components. These themes alone give
163
+ translucent colors with no blur.
164
+ - Same precedence trap as the base bond: template-based apps ship
165
+ `app/src/theme.css` whose `--color-*` variables SHADOW these theme colors —
166
+ when `theme.css` defines colors, wiring this preset changes nothing visible;
167
+ port the glass palette into `theme.css` instead (see
168
+ `@molecule/app-theme-css-variables` remarks for the full mechanism).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-theme-css-variables-liquid-glass",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Liquid glass theme preset with translucent surfaces for molecule.dev",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,7 +17,8 @@
17
17
  }
18
18
  },
19
19
  "files": [
20
- "dist"
20
+ "dist",
21
+ "README.md"
21
22
  ],
22
23
  "keywords": [
23
24
  "molecule",
@@ -31,18 +32,18 @@
31
32
  "devDependencies": {
32
33
  "@types/node": "26.1.2",
33
34
  "typescript": "6.0.3",
34
- "vitest": "4.1.10"
35
+ "vitest": "4.1.11"
35
36
  },
36
37
  "peerDependencies": {
37
- "@molecule/app-theme": "^1.0.0",
38
- "@molecule/app-theme-css-variables": "^1.0.0"
38
+ "@molecule/app-theme": "^1.0.1",
39
+ "@molecule/app-theme-css-variables": "^1.0.1"
39
40
  },
40
41
  "repository": {
41
42
  "type": "git",
42
43
  "url": "https://github.com/molecule-dev/molecule.git",
43
44
  "directory": "packages/app/bonds/theme/css-variables-liquid-glass"
44
45
  },
45
- "homepage": "https://github.com/molecule-dev/molecule/tree/main/packages/app/bonds/theme/css-variables-liquid-glass",
46
+ "homepage": "https://www.molecule.dev/packages/app-theme-css-variables-liquid-glass",
46
47
  "bugs": "https://github.com/molecule-dev/molecule/issues",
47
48
  "publishConfig": {
48
49
  "access": "public"