@molecule/app-theme-css-variables-liquid-glass 1.0.0 → 1.0.1
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.
- package/README.md +159 -0
- package/package.json +5 -4
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
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-08-04T01:52:56.382Z
|
|
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
|
+
```
|
|
82
|
+
|
|
83
|
+
#### `ThemeStorageAdapter`
|
|
84
|
+
|
|
85
|
+
Minimal storage adapter for theme persistence. Compatible with
|
|
86
|
+
localStorage, sessionStorage, or any custom implementation
|
|
87
|
+
(e.g., React Native AsyncStorage wrapper, SSR no-op).
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
interface ThemeStorageAdapter {
|
|
91
|
+
getItem(key: string): string | null
|
|
92
|
+
setItem(key: string, value: string): void
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Functions
|
|
97
|
+
|
|
98
|
+
#### `createCSSVariablesThemeProvider(config)`
|
|
99
|
+
|
|
100
|
+
Creates a framework-agnostic ThemeProvider that applies theme tokens
|
|
101
|
+
as CSS custom properties on the document root element.
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
function createCSSVariablesThemeProvider(config: CSSVariablesThemeConfig): ThemeProvider
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- `config` — Theme provider configuration (available themes, default theme, CSS variable prefix, persistence).
|
|
108
|
+
|
|
109
|
+
**Returns:** A ThemeProvider that applies themes as CSS custom properties on the document root.
|
|
110
|
+
|
|
111
|
+
### Constants
|
|
112
|
+
|
|
113
|
+
#### `darkTheme`
|
|
114
|
+
|
|
115
|
+
Liquid glass dark theme.
|
|
116
|
+
|
|
117
|
+
Translucent dark surfaces over blurred backgrounds.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
const darkTheme: Theme
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### `lightTheme`
|
|
124
|
+
|
|
125
|
+
Liquid glass light theme.
|
|
126
|
+
|
|
127
|
+
Translucent white surfaces over blurred backgrounds.
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
const lightTheme: Theme
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Core Interface
|
|
134
|
+
|
|
135
|
+
Implements `@molecule/app-theme` interface.
|
|
136
|
+
|
|
137
|
+
## Injection Notes
|
|
138
|
+
|
|
139
|
+
### Requirements
|
|
140
|
+
|
|
141
|
+
Peer dependencies:
|
|
142
|
+
|
|
143
|
+
- `@molecule/app-theme` ^1.0.1
|
|
144
|
+
- `@molecule/app-theme-css-variables` ^1.0.1
|
|
145
|
+
|
|
146
|
+
### Runtime Dependencies
|
|
147
|
+
|
|
148
|
+
- `@molecule/app-theme`
|
|
149
|
+
- `@molecule/app-theme-css-variables`
|
|
150
|
+
|
|
151
|
+
- The frosted BLUR comes from the ClassMap, not from these themes: pair with
|
|
152
|
+
`@molecule/app-ui-tailwind-glass` (`setClassMap(classMap)`), which layers
|
|
153
|
+
`backdrop-filter` onto surface components. These themes alone give
|
|
154
|
+
translucent colors with no blur.
|
|
155
|
+
- Same precedence trap as the base bond: template-based apps ship
|
|
156
|
+
`app/src/theme.css` whose `--color-*` variables SHADOW these theme colors —
|
|
157
|
+
when `theme.css` defines colors, wiring this preset changes nothing visible;
|
|
158
|
+
port the glass palette into `theme.css` instead (see
|
|
159
|
+
`@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.
|
|
3
|
+
"version": "1.0.1",
|
|
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",
|
|
@@ -34,8 +35,8 @@
|
|
|
34
35
|
"vitest": "4.1.10"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
|
-
"@molecule/app-theme": "^1.0.
|
|
38
|
-
"@molecule/app-theme-css-variables": "^1.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",
|