wispcss 0.0.1 → 1.0.5
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/CHANGELOG.md +78 -0
- package/LICENSE +49 -0
- package/README.md +386 -0
- package/README.zh-CN.md +385 -0
- package/dist/wispcss.css +42758 -0
- package/dist/wispcss.min.css +2 -0
- package/examples/add-h2-ids.cjs +284 -0
- package/examples/demo-actions.html +188 -0
- package/examples/demo-alarm.html +219 -0
- package/examples/demo-animation.html +399 -0
- package/examples/demo-aura.html +195 -0
- package/examples/demo-avatar.html +279 -0
- package/examples/demo-background.html +284 -0
- package/examples/demo-badge.html +398 -0
- package/examples/demo-blob.html +307 -0
- package/examples/demo-blockquote.html +190 -0
- package/examples/demo-bookmark.html +243 -0
- package/examples/demo-breadcrumb.html +179 -0
- package/examples/demo-btns.html +349 -0
- package/examples/demo-bubble.html +215 -0
- package/examples/demo-buoy.html +187 -0
- package/examples/demo-button-icon.html +231 -0
- package/examples/demo-button-link.html +177 -0
- package/examples/demo-button.html +361 -0
- package/examples/demo-callout.html +601 -0
- package/examples/demo-check.html +323 -0
- package/examples/demo-code.html +212 -0
- package/examples/demo-color.html +545 -0
- package/examples/demo-comment.html +510 -0
- package/examples/demo-deform.html +229 -0
- package/examples/demo-dialog.html +932 -0
- package/examples/demo-divider.html +208 -0
- package/examples/demo-drawer.html +623 -0
- package/examples/demo-dropmenu.html +382 -0
- package/examples/demo-droppanel.html +354 -0
- package/examples/demo-ellipsis.html +145 -0
- package/examples/demo-emphasis.html +146 -0
- package/examples/demo-empty.html +112 -0
- package/examples/demo-entry.html +219 -0
- package/examples/demo-field.html +359 -0
- package/examples/demo-file.html +206 -0
- package/examples/demo-flag.html +225 -0
- package/examples/demo-form.html +201 -0
- package/examples/demo-gilt.html +170 -0
- package/examples/demo-heading.html +93 -0
- package/examples/demo-icon.html +164 -0
- package/examples/demo-input.html +300 -0
- package/examples/demo-kbd.html +202 -0
- package/examples/demo-lamp.html +248 -0
- package/examples/demo-link.html +142 -0
- package/examples/demo-normalize.html +366 -0
- package/examples/demo-otp.html +277 -0
- package/examples/demo-pagination.html +562 -0
- package/examples/demo-position.html +205 -0
- package/examples/demo-poster.html +384 -0
- package/examples/demo-pre - /345/211/257/346/234/254.html" +169 -0
- package/examples/demo-pre.html +205 -0
- package/examples/demo-preset.html +344 -0
- package/examples/demo-progress.html +303 -0
- package/examples/demo-range.html +211 -0
- package/examples/demo-rank.html +270 -0
- package/examples/demo-rating.html +251 -0
- package/examples/demo-reset.html +105 -0
- package/examples/demo-segment.html +436 -0
- package/examples/demo-select.html +332 -0
- package/examples/demo-shadow.html +152 -0
- package/examples/demo-shell.html +377 -0
- package/examples/demo-shimmer.html +217 -0
- package/examples/demo-size.html +149 -0
- package/examples/demo-skeleton.html +143 -0
- package/examples/demo-sketch.html +213 -0
- package/examples/demo-spacer.html +150 -0
- package/examples/demo-spinner.html +220 -0
- package/examples/demo-stats.html +165 -0
- package/examples/demo-status.html +212 -0
- package/examples/demo-step.html +240 -0
- package/examples/demo-styles.css +14 -0
- package/examples/demo-summary.html +128 -0
- package/examples/demo-swatch.html +253 -0
- package/examples/demo-switch.html +223 -0
- package/examples/demo-table.html +339 -0
- package/examples/demo-tag.html +318 -0
- package/examples/demo-text.html +91 -0
- package/examples/demo-theme.html +167 -0
- package/examples/demo-tools.html +152 -0
- package/examples/demo-transition.html +169 -0
- package/examples/demo-tree.html +929 -0
- package/examples/demo-underline.html +76 -0
- package/examples/demo-utils.js +131 -0
- package/examples/demo-validate.html +120 -0
- package/examples/index.html +149 -0
- package/package.json +72 -8
- package/script-gen-color.js +148 -0
- package/script-mini.js +77 -0
- package/script-prefix.js +398 -0
- package/skill.md +575 -0
package/skill.md
ADDED
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
# WispCSS – AI Reference Guide
|
|
2
|
+
|
|
3
|
+
> This guide tells AI how to read WispCSS's source files and generate correct HTML using its utility classes — both standalone and in combination.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. How to Learn WispCSS
|
|
8
|
+
|
|
9
|
+
Read files in this order:
|
|
10
|
+
|
|
11
|
+
1. **`src/core.css`** — component registry: what components exist, their filenames, and load order (`src/index.css` is the same registry with `@import "tailwindcss";` in front of it)
|
|
12
|
+
2. **`src/[component].css`** — for each component:
|
|
13
|
+
- Block comment at the top: full usage docs, supported features, combination rules
|
|
14
|
+
- `@utility` declarations: all valid class names
|
|
15
|
+
- `@composable` / `@exclusive` tags: which utilities combine vs. conflict
|
|
16
|
+
- `@example` tags: usage snippets
|
|
17
|
+
3. **`examples/demo-[component].html`** — real-world HTML patterns and class combinations
|
|
18
|
+
4. **`src/utilities.css`** — general-purpose layout, positioning, scroll, and safe-area helpers
|
|
19
|
+
|
|
20
|
+
### Entry Files
|
|
21
|
+
|
|
22
|
+
| File | Imports Tailwind? | Use when |
|
|
23
|
+
| ---------------------- | ------------------ | ------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| `src/index.css` | Yes | The project does not import Tailwind anywhere else — it is `@import "tailwindcss";` + `core.css` |
|
|
25
|
+
| `src/core.css` | No | Tailwind is already imported elsewhere (framework preset, shared entry, custom `prefix()` / `@theme`) |
|
|
26
|
+
| `src-prefix/index.css` | Yes, `prefix(tw)` | Classes must be namespaced (`tw:btn-primary`) and WispCSS should bring Tailwind |
|
|
27
|
+
| `src-prefix/core.css` | No | Namespaced classes, but Tailwind with the **same** prefix is already imported elsewhere |
|
|
28
|
+
|
|
29
|
+
- `core.css` contains every component, utility and design token, but no Tailwind import.
|
|
30
|
+
- `core.css` must be imported **after** Tailwind; it cannot be compiled alone because it relies on `@utility`, `@theme`, `--theme()` and `--spacing()`.
|
|
31
|
+
- Class names, combination rules and tree-shaking are identical with either file — including both would duplicate the component layer.
|
|
32
|
+
|
|
33
|
+
npm subpaths (only work when the source sits in `node_modules/@zimeko/wispcss/`; the `.css` extension is optional):
|
|
34
|
+
|
|
35
|
+
| Specifier | File |
|
|
36
|
+
| ------------------------------------ | ------------------------------- |
|
|
37
|
+
| `@zimeko/wispcss` | `src/index.css` |
|
|
38
|
+
| `@zimeko/wispcss/core.css` | `src/core.css` |
|
|
39
|
+
| `@zimeko/wispcss/<component>` | `src/<component>.css` |
|
|
40
|
+
| `@zimeko/wispcss/prefix` | `src-prefix/index.css` |
|
|
41
|
+
| `@zimeko/wispcss/prefix/core.css` | `src-prefix/core.css` |
|
|
42
|
+
| `@zimeko/wispcss/prefix/<component>` | `src-prefix/<component>.css` |
|
|
43
|
+
|
|
44
|
+
```css
|
|
45
|
+
/* Case A: the project has no Tailwind import yet */
|
|
46
|
+
@import "./lib/wispcss/src/index.css";
|
|
47
|
+
|
|
48
|
+
/* Case B: Tailwind is already imported somewhere else */
|
|
49
|
+
@import "tailwindcss";
|
|
50
|
+
@import "./lib/wispcss/src/core.css";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 2. Component Reference
|
|
56
|
+
|
|
57
|
+
### 2.1 Button (`src/button.css` / `examples/demo-button.html`)
|
|
58
|
+
|
|
59
|
+
| Feature | Details |
|
|
60
|
+
| -------- | ----------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| Base | `btn` — required on all buttons |
|
|
62
|
+
| Variants | `btn-solid` `btn-subtle` `btn-outline` `btn-ghost` `btn-vivid` `btn-link` |
|
|
63
|
+
| Colors | `btn-*` `btn-solid-*` `btn-outline-*` `btn-muted-*` `btn-subtle-*` `btn-vivid-*` `btn-ghost-*` `btn-link-*` |
|
|
64
|
+
| Size | `btn-4` ~ `btn-15` (height = spacing × N) |
|
|
65
|
+
| Shape | `btn-pill` (capsule) · `btn-rounded` (small radius) · `btn-square` (no radius) · `btn-fluid` (stretch) |
|
|
66
|
+
| Width | `btn-icon` `btn-ratio[-*]` `btn-scale[-*]` `btn-gutter[-*]` `btn-full` |
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<button class="btn btn-primary">Submit</button>
|
|
70
|
+
<button class="btn btn-outline-error">Cancel</button>
|
|
71
|
+
<button class="btn btn-primary btn-10 btn-pill">Large Pill Button</button>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
> **`<button>` and `<input type="submit/reset/button">`** already receive base `btn` styles from `preset.css`. You only need `btn` variants explicitly.
|
|
75
|
+
|
|
76
|
+
#### Button Group — Btns (`src/btns.css` / `examples/demo-btns.html`)
|
|
77
|
+
|
|
78
|
+
- `btns` container merges adjacent borders and manages hover/focus z-index automatically
|
|
79
|
+
- Direction: `btns-top` `btns-start` `btns-end` (default: bottom — pairs with tab patterns)
|
|
80
|
+
- Flush: `btns-flush` — removes outer border for seamless card embedding
|
|
81
|
+
- Shape: `btns-pill` `btns-rounded` `btns-square` `btns-fluid`
|
|
82
|
+
- Width: `btns-full` `btns-scale[-*]`
|
|
83
|
+
- Size: `btns-4` ~ `btns-15`
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### 2.2 Badge (`src/badge.css` / `examples/demo-badge.html`)
|
|
88
|
+
|
|
89
|
+
| Feature | Details |
|
|
90
|
+
| -------- | ---------------------------------------------------------------------------- |
|
|
91
|
+
| Auto-dot | Empty `<span class="badge">` collapses to an 8px dot |
|
|
92
|
+
| Colors | `badge-*` `badge-outline-*` `badge-subtle-*` `badge-muted-*` `badge-solid-*` |
|
|
93
|
+
| Size | `badge-2xs` `badge-xs` `badge-sm` `badge-lg` `badge-xl` `badge-2xl` |
|
|
94
|
+
| Shape | `badge-rounded` `badge-pill` `badge-square` |
|
|
95
|
+
| Special | `badge-glassy` (frosted glass) · `badge-scoop-start/end` (notched corner) |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### 2.3 Form Components
|
|
100
|
+
|
|
101
|
+
#### Avatar (`src/avatar.css` / `examples/demo-avatar.html`)
|
|
102
|
+
|
|
103
|
+
- Wraps `<img>` / `<svg>` / `<picture>`; shows placeholder text when empty
|
|
104
|
+
- Colors: `avatar-*` `avatar-subtle-*` `avatar-muted-*`
|
|
105
|
+
- Shape: `avatar-circle` (true circle; `avatar-pill` is an alias) · `avatar-rounded` · `avatar-square` · `avatar-fluid` · `avatar-scoop` (superellipse) · `avatar-beveled` (clipped octagon) · `avatar-squircle` (SVG mask) · `avatar-flower` (petal) · `avatar-bubble-start/end` (chat tail)
|
|
106
|
+
- Size: `avatar-4` ~ `avatar-30`
|
|
107
|
+
|
|
108
|
+
#### Input (`src/input.css` / `examples/demo-input.html`)
|
|
109
|
+
|
|
110
|
+
- `<input>` `<textarea>` `<select>` `<input type="file">` `<input type="range">` all share the same `input-*` classes
|
|
111
|
+
- Variants: `input-subtle` `input-ghost` `input-underline` `input-outline`
|
|
112
|
+
- Colors: `input-primary` `input-success` `input-warning` `input-error` `input-info`
|
|
113
|
+
- Size: `input-4` ~ `input-15`
|
|
114
|
+
- Shape: `input-pill` `input-rounded` `input-square` `input-fluid`
|
|
115
|
+
- Width: `input-scale[-*]` `input-ratio[-*]` `input-full` `input-inline`
|
|
116
|
+
|
|
117
|
+
> Base styles are auto-applied via `preset.css`. Extra classes are modifiers only.
|
|
118
|
+
|
|
119
|
+
**Range (`input[type=range]`)** — only `color`, `size`, and `width` modifiers are effective; shape and variant only change colors, not the track/thumb geometry.
|
|
120
|
+
|
|
121
|
+
**Select multiple** — `input-pill` doesn't apply. Control height via `--input-count` CSS var (row count) or `max-height`.
|
|
122
|
+
|
|
123
|
+
#### File Input (`src/input.css` / `examples/demo-file.html`)
|
|
124
|
+
|
|
125
|
+
All `input-*` classes work identically on `<input type="file">`.
|
|
126
|
+
|
|
127
|
+
#### OTP (`src/otp.css` / `examples/demo-otp.html`)
|
|
128
|
+
|
|
129
|
+
- `otp` container: auto-arranges `<input>` fields in a square grid
|
|
130
|
+
- `otp-group`: merges inputs into a gapless group
|
|
131
|
+
- `otp-gutter-*`: controls spacing between inputs (controls overall width)
|
|
132
|
+
|
|
133
|
+
#### Shell (`src/shell.css` / `examples/demo-shell.html`)
|
|
134
|
+
|
|
135
|
+
A decorative wrapper around a real `<input>` with support for prefix/suffix slots.
|
|
136
|
+
|
|
137
|
+
- Base layout (pick one): `shell` / `shell-h` (both horizontal, default) · `shell-v` (vertical)
|
|
138
|
+
- Variants: `shell-subtle` `shell-ghost` `shell-underline` `shell-outline`
|
|
139
|
+
- Colors: `shell-*` `shell-outline-*` `shell-muted-*` `shell-subtle-*` `shell-ghost-*` `shell-underline-*`
|
|
140
|
+
- Size: `shell-4` ~ `shell-15`
|
|
141
|
+
- Shape: `shell-pill` `shell-rounded` `shell-square` `shell-fluid`
|
|
142
|
+
- Width: `shell-scale[-*]` `shell-ratio[-*]` `shell-full`
|
|
143
|
+
|
|
144
|
+
**Floating placeholder** (horizontal single-line only): requires all three:
|
|
145
|
+
1. A `[data-role="placeholder"]` element
|
|
146
|
+
2. `<input placeholder=" ">` (one space)
|
|
147
|
+
3. `shell-10` or larger
|
|
148
|
+
|
|
149
|
+
#### Checkbox / Radio (`src/check.css` / `examples/demo-check.html`)
|
|
150
|
+
|
|
151
|
+
- Base: `check` + color, e.g. `check-primary`
|
|
152
|
+
- Variants: `check-subtle` `check-vivid` `check-ghost` `check-outline` `check-muted` `check-tick` (icon only, no box)
|
|
153
|
+
- Shape: `check-rounded` `check-pill` `check-square` `check-fluid`
|
|
154
|
+
- Behavior: `check-full` (full width) · `check-reverse` (control on right) · `check-multiline` (top-align with long labels) · `check-indeterminate` · `check-bold` (2px border)
|
|
155
|
+
|
|
156
|
+
#### Switch (`src/switch.css` / `examples/demo-switch.html`)
|
|
157
|
+
|
|
158
|
+
For `<input type="checkbox">`.
|
|
159
|
+
|
|
160
|
+
- Shape: `switch-rounded` `switch-square`
|
|
161
|
+
- State: `switch-indeterminate`
|
|
162
|
+
- Size: `switch-2xs` ~ `switch-5xl`
|
|
163
|
+
|
|
164
|
+
#### Rating (`src/rating.css` / `examples/demo-rating.html`)
|
|
165
|
+
|
|
166
|
+
- `rating` container wraps `<input type="radio">` or `[data-role=item]` elements
|
|
167
|
+
- Adjacent radios auto-form half-star behavior
|
|
168
|
+
- `rating-radio`: each star toggles independently (no cumulative selection)
|
|
169
|
+
- Width: `rating-full` `rating-scale[-*]` `rating-ratio-*`
|
|
170
|
+
- Gutter: `rating-gutter[-*]`
|
|
171
|
+
- Size: `rating-4` ~ `rating-15`
|
|
172
|
+
|
|
173
|
+
#### Field (`src/field.css` / `examples/demo-field.html`)
|
|
174
|
+
|
|
175
|
+
Vertical form field layout container.
|
|
176
|
+
|
|
177
|
+
- Layout: `field` / `field-v` (vertical, default) · `field-h` (horizontal)
|
|
178
|
+
- Slot roles: `[data-role=label]` `[data-role=content]` `[data-role=control]` `[data-role=note]` `[data-role=help]`
|
|
179
|
+
- Width: `field-full` `field-scale[-*]` `field-ratio[-*]`
|
|
180
|
+
- Visual: `field-borderless`
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### 2.4 Navigation
|
|
185
|
+
|
|
186
|
+
#### Breadcrumb (`src/breadcrumb.css` / `examples/demo-breadcrumb.html`)
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
breadcrumb
|
|
190
|
+
├── [data-role=header] # prefix (home icon, etc.)
|
|
191
|
+
├── [data-role=label] # regular node
|
|
192
|
+
├── [data-role=hyphen] # separator (e.g. "/")
|
|
193
|
+
└── [data-selected=true] # current page highlight
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Variants: `breadcrumb-subtle` (filled chip) · `breadcrumb-ghost` (hover fill) · `breadcrumb-muted` (1px outline)
|
|
197
|
+
|
|
198
|
+
#### Pagination (`src/pagination.css` / `examples/demo-pagination.html`)
|
|
199
|
+
|
|
200
|
+
- `pagination` container; child roles: `[data-role=main/pages/page/previous/next/first/last/ellipsis/total/goto/size/custom]`
|
|
201
|
+
- Visual: `pagination-plain` (no border)
|
|
202
|
+
- Align: `pagination-start` `pagination-end`
|
|
203
|
+
- Shape: `pagination-rounded` `pagination-square` `pagination-pill` `pagination-fluid`
|
|
204
|
+
- Size: `pagination-4` ~ `pagination-15`
|
|
205
|
+
- `pagination-turning`: prevents layout collapse when content is cleared
|
|
206
|
+
|
|
207
|
+
#### Dropmenu (`src/dropmenu.css` / `examples/demo-dropmenu.html`)
|
|
208
|
+
|
|
209
|
+
Pure CSS multi-level `ul + li` dropdown. Supports hover and click-to-toggle.
|
|
210
|
+
|
|
211
|
+
- Modes: `dropmenu-inline` (in-flow) · `dropmenu-list` (fully expanded list)
|
|
212
|
+
- Position: `dropmenu-top[-start/-end]` `dropmenu-bottom[-start/-end]` (default) `dropmenu-start[-top/-bottom]` `dropmenu-end[-top/-bottom]`
|
|
213
|
+
- Submenu direction: `dropmenu-downward-end` (default) · `dropmenu-downward-start` · `dropmenu-upward-start/end` · `dropmenu-upright` (centered)
|
|
214
|
+
- Visual: `dropmenu-ghost`
|
|
215
|
+
|
|
216
|
+
#### Droppanel (`src/droppanel.css` / `examples/demo-droppanel.html`)
|
|
217
|
+
|
|
218
|
+
Like Dropmenu but with a freeform `[data-role=panel]` instead of a fixed `ul/li` structure.
|
|
219
|
+
|
|
220
|
+
- Mode: `droppanel-inline`
|
|
221
|
+
- Position: same 12 directions as Dropmenu (`droppanel-top` ~ `droppanel-end-bottom`)
|
|
222
|
+
|
|
223
|
+
#### Step (`src/step.css` / `examples/demo-step.html`)
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
step
|
|
227
|
+
└── [data-selected=true] # current / completed step
|
|
228
|
+
├── [data-role=track] # connector line (two <span>s)
|
|
229
|
+
├── [data-role=node] # step number or icon
|
|
230
|
+
└── [data-role=label] # step name
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
- Base layout (pick one): `step` / `step-h` (both horizontal, default) · `step-v` (vertical)
|
|
234
|
+
- Layout: `step-between` (space-between) · `step-trim` (clip first/last track)
|
|
235
|
+
- Variants: `step-solid` `step-plain`
|
|
236
|
+
- State: `step-pending`
|
|
237
|
+
- Direction: `step-reverse`
|
|
238
|
+
|
|
239
|
+
#### Tab Components — Lamp / Bookmark / Segment
|
|
240
|
+
|
|
241
|
+
All three support pure-CSS tab switching via `<label><input type="radio"></label>` — no JavaScript needed.
|
|
242
|
+
|
|
243
|
+
| Component | Visual Style | Best For |
|
|
244
|
+
| ---------- | ----------------------------- | ----------------------------------------------------------------- |
|
|
245
|
+
| `lamp` | Thin underline indicator | Top navbars, content category tabs (e.g. Zhihu / Instagram-style) |
|
|
246
|
+
| `bookmark` | Browser-tab / bookmark shape | Card tabs, panel switchers (connected to content below) |
|
|
247
|
+
| `segment` | Pill-shaped segmented control | Inline filters, view toggles (iOS Segmented Control style) |
|
|
248
|
+
|
|
249
|
+
**Lamp (`src/lamp.css` / `examples/demo-lamp.html`)**
|
|
250
|
+
- Direction: `lamp-top` `lamp-start` `lamp-end` (default: bottom)
|
|
251
|
+
- Full width: `lamp-full`
|
|
252
|
+
- Colors: `lamp-*` — supports `lamp-description` `lamp-caption` `lamp-placeholder`
|
|
253
|
+
- Size: `lamp-4` ~ `lamp-15`
|
|
254
|
+
|
|
255
|
+
**Bookmark (`src/bookmark.css` / `examples/demo-bookmark.html`)**
|
|
256
|
+
- Direction: `bookmark-top` `bookmark-start` `bookmark-end` (default: bottom)
|
|
257
|
+
- Visual: `bookmark-inverted` (dark bg, light active tab)
|
|
258
|
+
- Layout: `bookmark-flex` · `bookmark-grid` (equal width) · `bookmark-gapped` (track bg) · `bookmark-flush` (edge-to-edge)
|
|
259
|
+
- Shape: `bookmark-rounded` `bookmark-fluid` `bookmark-pill`
|
|
260
|
+
- Colors: `bookmark-*` — supports `bookmark-description` etc.
|
|
261
|
+
- Size: `bookmark-4` ~ `bookmark-15`
|
|
262
|
+
|
|
263
|
+
**Segment (`src/segment.css` / `examples/demo-segment.html`)**
|
|
264
|
+
- Visual: `segment-dark` (dark bg) · `segment-inverted` · `segment-flush` (no padding)
|
|
265
|
+
- Shape: `segment-rounded` `segment-fluid` `segment-square` `segment-pill`
|
|
266
|
+
- Layout: `segment-grid` (equal width)
|
|
267
|
+
- Colors: `segment-*` — supports `segment-description` etc.
|
|
268
|
+
- Size: `segment-4` ~ `segment-15`
|
|
269
|
+
|
|
270
|
+
#### Toolbar — Tools (`src/tools.css` / `examples/demo-tools.html`)
|
|
271
|
+
|
|
272
|
+
Inline icon action buttons (e.g. edit/delete/more at the end of a list row).
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### 2.5 Data Display
|
|
277
|
+
|
|
278
|
+
| Component | File | Description |
|
|
279
|
+
| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
280
|
+
| Tag | `src/tag.css` | Chip/label — like badge but no auto-dot behavior |
|
|
281
|
+
| Flag | `src/flag.css` | Corner decorations (triangle, circle, ribbon, diamond) for promo/badges |
|
|
282
|
+
| Buoy | `src/buoy.css` | Two-segment badge (label+value), like GitHub shields.io badges |
|
|
283
|
+
| Rank | `src/rank.css` | Numeric rank indicator |
|
|
284
|
+
| Stats | `src/stats.css` | Stat display block with `[data-role=main/label/tips]` slots |
|
|
285
|
+
| Progress | `src/progress.css` | Progress bar — native `<progress>` or `[data-role=bar]` custom |
|
|
286
|
+
| Spinner | `src/spinner.css` | Loading spinner; variants: `spinner-gapped` / `spinner-broken`; size: `spinner-1` ~ `spinner-15` |
|
|
287
|
+
| Swatch | `src/swatch.css` | Color chip — mimics `<input type="color">` appearance |
|
|
288
|
+
| Poster | `src/poster.css` | Image cover container — supports aspect ratios like `poster-16x9`, hover zoom/overlay |
|
|
289
|
+
| Icon | `src/icon.css` | SVG icon via `mask-image`; colorable with `currentColor` |
|
|
290
|
+
| Skeleton | `src/skeleton.css` | Loading placeholder — shimmer by default; `skeleton-pulse` for pulse variant |
|
|
291
|
+
| Table | `src/table.css` | Table enhancements: striped rows, hover highlight, sticky columns, alignment |
|
|
292
|
+
| Tree | `src/tree.css` | Hierarchical `ul/li` tree — `data-role=node/content/label/arrow/children/note/indent/group/toggle` slots, states, shapes, densities, indent modes, expand levels, CSS-only toggle |
|
|
293
|
+
|
|
294
|
+
**Tree (`src/tree.css` / `examples/demo-tree.html`)**
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
tree
|
|
298
|
+
└── ul > li
|
|
299
|
+
├── div[data-role=node] # or label[data-role=node] when using toggle
|
|
300
|
+
│ ├── span[data-role=indent] # tree-indent-dedicated only
|
|
301
|
+
│ ├── input[data-role=toggle] # optional CSS-only toggle (inside a <label>)
|
|
302
|
+
│ ├── label.check # optional checkbox
|
|
303
|
+
│ ├── div[data-role=content]
|
|
304
|
+
│ │ └── span[data-role=label]
|
|
305
|
+
│ └── span[data-role=arrow] # branch nodes only (leaf arrows auto-hidden)
|
|
306
|
+
├── div[data-role=note] # optional description row
|
|
307
|
+
└── div[data-role=children] # required wrapper for nested levels
|
|
308
|
+
└── ul > li ... # recursive (top-level ul needs NO wrapper)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
- Trees cannot be nested; structure must be `ul > li`. Nested child levels are wrapped by `div[data-role=children] > ul` placed right after the node row — the top-level `ul` does NOT need a `children` wrapper
|
|
312
|
+
- Every `data-role=node` should carry a `data-role=arrow` child (even leaf nodes) to keep indentation consistent; the arrow content hides automatically for leaves
|
|
313
|
+
- CSS-only interactivity: insert `<input type="checkbox" data-role="toggle">` and wrap it in a `<label>` — either as a standalone slot inside the node, or make the entire node a `<label data-role="node">` so the whole row toggles on click
|
|
314
|
+
- Grouping: `div[data-role=group]` as a non-selectable section header; its label indentation aligns with child nodes (children share the same `--tree-level` in dedicated mode)
|
|
315
|
+
- Expand/collapse animates smoothly via `grid-template-rows`
|
|
316
|
+
- States: `tree-selected` (whole row) · `tree-active` (label only) · `tree-disabled` (node or root) · `tree-hoverable`
|
|
317
|
+
- Shape: `tree-square` `tree-rounded` `tree-pill`
|
|
318
|
+
- Density: `tree-tight` `tree-snug` `tree-compact` `tree-relaxed` `tree-loose`
|
|
319
|
+
- Indent: `tree-indent-cascading` (default) · `tree-indent-dedicated` (requires `--tree-level` on each `li` + `span[data-role=indent]`)
|
|
320
|
+
- Node style: `tree-btns` (button chips) · `tree-entries` (list style, fully expanded, check icon on selected)
|
|
321
|
+
- Expand: `tree-expanded` (one branch) · `tree-expanded-all` (all) · `tree-expanded-1` ~ `tree-expanded-10` (depth presets)
|
|
322
|
+
- Colors: `tree-*` (e.g. `tree-primary` `tree-success` `tree-warning`)
|
|
323
|
+
- Feature: `tree-padded`
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
### 2.6 Typography
|
|
328
|
+
|
|
329
|
+
| Component | File | Notes |
|
|
330
|
+
| ---------- | -------------------- | ------------------------------------------------------ |
|
|
331
|
+
| Link | `src/link.css` | — |
|
|
332
|
+
| Emphasis | `src/emphasis.css` | Text emphasis marks (above/below) |
|
|
333
|
+
| Underline | `src/underline.css` | — |
|
|
334
|
+
| Ellipsis | `src/ellipsis.css` | Single/multiline truncation: `ellipsis-2` `ellipsis-3` |
|
|
335
|
+
| Gilt | `src/gilt.css` | Gradient text effect ("gilt" = gilded/gold-plated) |
|
|
336
|
+
| Kbd | `src/kbd.css` | Keyboard key style |
|
|
337
|
+
| Code | `src/code.css` | Inline code highlight |
|
|
338
|
+
| Pre | `src/pre.css` | Block highlight |
|
|
339
|
+
| Blockquote | `src/blockquote.css` | Quote blocks — `quote` / `bar` / `card` layouts |
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
### 2.7 Layout
|
|
344
|
+
|
|
345
|
+
| Component | File | Structure |
|
|
346
|
+
| --------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------ |
|
|
347
|
+
| Divider | `src/divider.css` | `<hr class="divider">` (h) / `divider-v` (v); supports label text, `dotted`/`dashed`/`slash` styles |
|
|
348
|
+
| Spacer | `src/spacer.css` | Flex fill / equal spacing |
|
|
349
|
+
| Comment | `src/comment.css` | `comments` → `comment` → `comment-start` + `comment-end` → `comment-header` + `comment-body` + `comment-footer` |
|
|
350
|
+
| Entry | `src/entry.css` | List row: `entry` → `entry-body` → `entry-label`; supports hoverable/selected/checked states and line-clamp |
|
|
351
|
+
| Position | `src/position.css` | Fixed / absolute / sticky positioning — cover, centering, corner anchors, sticky offsets (logical properties, RTL-ready) |
|
|
352
|
+
| Actions | `src/actions.css` | Footer action bar — `actions` container with `actions-start` / `actions-center` / `actions-end` aligned groups |
|
|
353
|
+
|
|
354
|
+
**Position (`src/position.css` / `examples/demo-position.html`)**
|
|
355
|
+
|
|
356
|
+
- Cover (stretch to fill viewport or parent):
|
|
357
|
+
- `fixed-cover` `fixed-cover-x` `fixed-cover-y` + dynamic gap variants `fixed-cover-*` `fixed-cover-x-*` `fixed-cover-y-*` (e.g. `fixed-cover-4`, `fixed-cover-[8px]`)
|
|
358
|
+
- `absolute-cover` `absolute-cover-x` `absolute-cover-y` + `absolute-cover-*` `absolute-cover-x-*` `absolute-cover-y-*` (requires `position: relative` on parent)
|
|
359
|
+
- Centering (auto margins + fit-content):
|
|
360
|
+
- `fixed-center` / `fixed-center-x` / `fixed-center-y`
|
|
361
|
+
- `absolute-center` / `absolute-center-x` / `absolute-center-y`
|
|
362
|
+
- Corner anchors:
|
|
363
|
+
- `fixed-top-start` `fixed-top-end` `fixed-bottom-start` `fixed-bottom-end`
|
|
364
|
+
- `absolute-top-start` `absolute-top-end` `absolute-bottom-start` `absolute-bottom-end`
|
|
365
|
+
- Sticky (requires a scrollable container):
|
|
366
|
+
- `sticky-top` `sticky-bottom` `sticky-start` `sticky-end` (logical properties)
|
|
367
|
+
- Dynamic offsets: `sticky-top-4` `sticky-top-[8px]` `sticky-bottom-2` `sticky-start-4` `sticky-end-10` (`sticky-*-*`)
|
|
368
|
+
|
|
369
|
+
**Actions (`src/actions.css` / `examples/demo-actions.html`)**
|
|
370
|
+
|
|
371
|
+
- `actions` — footer action bar for card / dialog / modal bottom areas
|
|
372
|
+
- Child groups (each lays items in a row with a consistent gap; mix text, buttons, checkboxes, switch, ellipsis text, avatars, icons freely):
|
|
373
|
+
- `actions-start` — left-aligned group
|
|
374
|
+
- `actions-center` — center-aligned group
|
|
375
|
+
- `actions-end` — right-aligned group
|
|
376
|
+
- An empty `actions` bar is hidden automatically
|
|
377
|
+
|
|
378
|
+
```html
|
|
379
|
+
<div class="actions">
|
|
380
|
+
<div class="actions-start"><label class="check"><input type="checkbox" /> Check it</label></div>
|
|
381
|
+
<div class="actions-center">1/4</div>
|
|
382
|
+
<div class="actions-end"><button>Cancel</button><button class="btn-primary">Confirm</button></div>
|
|
383
|
+
</div>
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
### 2.8 Decoration
|
|
389
|
+
|
|
390
|
+
| Component | File | Description |
|
|
391
|
+
| ---------- | -------------------- | ---------------------------------------------------------------------------------------------- |
|
|
392
|
+
| Background | `src/background.css` | Geometric textures (dot/hatch/grid/stripes/chessboard) + gradient blends (`bg-whisper` series) |
|
|
393
|
+
| Blob | `src/blob.css` | Organic shapes (circle/triangle/diamond/drop/kidney); supports morph animation |
|
|
394
|
+
| Bubble | `src/bubble.css` | Arrow speech bubble — `bubble-top/bottom/start/end` + `-start/-end` anchor variants |
|
|
395
|
+
| Callout | `src/callout.css` | Alert/notice box |
|
|
396
|
+
| Alarm | `src/alarm.css` | Pulsing alert dot/badge with dual ripple animation |
|
|
397
|
+
| Aura | `src/aura.css` | Glowing animated border — conic-gradient rotation |
|
|
398
|
+
| Sketch | `src/sketch.css` | Hand-drawn style: borders, underlines, highlights, dividers |
|
|
399
|
+
| Shadow | `src/shadow.css` | Box-shadow utilities — see `examples/demo-shadow.html` |
|
|
400
|
+
| Shimmer | `src/shimmer.css` | Sweep highlight effect (pairs well with skeleton) |
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
### 2.9 State / Status
|
|
405
|
+
|
|
406
|
+
| Component | File | Description |
|
|
407
|
+
| --------- | ---------------- | ------------------------------------------------------------------------------------------------------ |
|
|
408
|
+
| Status | `src/status.css` | Static status dot with optional right-side text |
|
|
409
|
+
| Deform | `src/deform.css` | Pure-CSS icon system — draws icons via pseudo-elements; supports morph transitions (e.g. plus → times) |
|
|
410
|
+
| Empty | `src/empty.css` | Empty state placeholder; `empty-illustrated` for image variant |
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
### 2.10 Utilities (`src/utilities.css`)
|
|
415
|
+
|
|
416
|
+
| Category | Classes |
|
|
417
|
+
| ---------- | ------------------------------------------------------------------------------------------------------- |
|
|
418
|
+
| Flex | `flex-center` `inline-flex-center` `flex-between` `flex-start` `flex-end` `flex-fluid` `flex-col-fluid` |
|
|
419
|
+
| Scroll | `scroll-y` `scroll-x` `overflow-touch` |
|
|
420
|
+
| State | `disabled` `inactive` |
|
|
421
|
+
| Hide | `hidden-visibility` `hidden-opacity` `hidden-appearance` |
|
|
422
|
+
| Reset | `reset-ul` `reset-ol` `reset-dl` `reset-heading` |
|
|
423
|
+
| Safe area | `pt-safe` `pb-safe` `px-safe` `py-safe` + margin variants |
|
|
424
|
+
| Transition | `duration-fastest` ~ `duration-slowest` · `transition-all-fastest` ~ `transition-all-slowest` |
|
|
425
|
+
| Icon | `icon-mask` |
|
|
426
|
+
| Other | `object-cover` (image fill) |
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
### 2.11 Preset, Normalize, Color & Theme
|
|
430
|
+
|
|
431
|
+
**`normalize.css`** — replaces Tailwind's preflight; depends on `@zimeko/normalize`.
|
|
432
|
+
|
|
433
|
+
**`preset.css`** — global base styles:
|
|
434
|
+
- Resets for `a` `code` `pre` `kbd` `blockquote` `ul` `ol` `dl` `hr` etc.
|
|
435
|
+
- Default styles for `input` `textarea` `select` `progress` `meter`
|
|
436
|
+
- Dark mode: `.dark` class + `@media (prefers-color-scheme: dark)`
|
|
437
|
+
- RTL support via `dir="rtl"`
|
|
438
|
+
|
|
439
|
+
**`color.css`** — color system:
|
|
440
|
+
- Theme variables: `--color-primary` `--color-success` `--color-error` etc. (base values in `color-base.css`)
|
|
441
|
+
- Token hierarchy: `*-surface` / `*-bg` / `*-bd` / `*-fg` / `*-hover` / `*-active` / `*-contrast` / `*-outline`
|
|
442
|
+
|
|
443
|
+
**`theme.css`** — theme switching variables and utilities.
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
### 2.12 Animation
|
|
448
|
+
|
|
449
|
+
| Component | File | Description |
|
|
450
|
+
| ---------- | -------------------- | --------------------------------------------------------- |
|
|
451
|
+
| Animation | `src/animation.css` | Keyframe utilities: spin, shake, fade, bounce, fly-in/out |
|
|
452
|
+
| Transition | `src/transition.css` | Transition helpers |
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
### 2.13 Validation (`src/validate.css` / `examples/demo-validate.html`)
|
|
457
|
+
|
|
458
|
+
CSS-only form validation via `:user-invalid`. Use with `pattern` attribute on inputs.
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## 3. Combination Rules
|
|
463
|
+
|
|
464
|
+
### 3.1 Mutual Exclusion (pick one per group)
|
|
465
|
+
|
|
466
|
+
- Button variant: `btn-solid` / `btn-outline` / `btn-subtle` / `btn-ghost` / `btn-vivid` / `btn-link`
|
|
467
|
+
- Button shape: `btn-pill` / `btn-rounded` / `btn-square` / `btn-fluid`
|
|
468
|
+
- Button width: `btn-icon` / `btn-ratio` / `btn-scale` / `btn-gutter` / `btn-full`
|
|
469
|
+
- Input variant: `input-subtle` / `input-ghost` / `input-underline` / `input-outline`
|
|
470
|
+
- Input shape: `input-pill` / `input-rounded` / `input-square` / `input-fluid`
|
|
471
|
+
- Shell base (pick one): `shell` / `shell-h` (identical, horizontal) / `shell-v` (vertical)
|
|
472
|
+
- Shell shape: `shell-pill` / `shell-rounded` / `shell-square` / `shell-fluid`
|
|
473
|
+
- Color tokens: `input-primary` and `input-success` conflict — pick one
|
|
474
|
+
|
|
475
|
+
### 3.2 Combinable Dimensions
|
|
476
|
+
|
|
477
|
+
Multiple dimension modifiers can be stacked simultaneously:
|
|
478
|
+
|
|
479
|
+
```
|
|
480
|
+
button = btn + [variant] + [color] + [size] + [shape] + [width]
|
|
481
|
+
input = [variant] + [color] + [size] + [shape] + [width]
|
|
482
|
+
shell = (shell|shell-h|shell-v) + [variant] + [color] + [size] + [shape] + [width]
|
|
483
|
+
badge = badge + [variant] + [color] + [size] + [shape]
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### 3.3 Shorthand Combinator Classes
|
|
487
|
+
|
|
488
|
+
Prefer combined utility classes over separate ones — they reduce CSS output size:
|
|
489
|
+
|
|
490
|
+
```
|
|
491
|
+
✅ input-subtle-primary (one class — recommended)
|
|
492
|
+
❌ input-subtle input-primary (two classes — generates more CSS)
|
|
493
|
+
|
|
494
|
+
✅ btn-outline-primary
|
|
495
|
+
❌ btn-outline btn-primary
|
|
496
|
+
|
|
497
|
+
✅ shell-subtle-primary
|
|
498
|
+
❌ shell-subtle shell-primary
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
This shorthand pattern applies to all form components (`input` / `select` / `shell`) and most display components (`badge` / `callout` / `buoy` / `rank` / `code` / `pre` etc.).
|
|
502
|
+
|
|
503
|
+
### 3.4 Common UI Patterns
|
|
504
|
+
|
|
505
|
+
Check these demo files for complete real-world examples:
|
|
506
|
+
|
|
507
|
+
- Full form → `demo-form.html`
|
|
508
|
+
- Button group toolbar → `demo-btns.html`
|
|
509
|
+
- Comment thread → `demo-comment.html`
|
|
510
|
+
- Search results list → `demo-entry.html`
|
|
511
|
+
- Modal dialog → `demo-dialog.html`
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
## 4. Output Guidelines
|
|
516
|
+
|
|
517
|
+
1. **All classes require Tailwind v4 compilation** — do not use raw CSS files directly.
|
|
518
|
+
2. **`<button>` and `<input type="submit/reset/button">`** auto-receive `btn` base styles from `preset.css`. No need to add `btn` explicitly — but variant classes (e.g. `btn-outline`) still need to be added.
|
|
519
|
+
3. **`<input>` `<textarea>` `<select>`** auto-receive input base styles. Extra classes are modifiers only. Same applies to `<input type="file">` and `<input type="range">`.
|
|
520
|
+
4. **`<code>` `<pre>` `<blockquote>` `<kbd>` `<progress>` `<meter>`** have base styles — classes are for variants only.
|
|
521
|
+
5. **Empty `<span class="badge"></span>`** auto-collapses to an 8px dot.
|
|
522
|
+
6. **Dark mode**: add `dark` class to any ancestor, or rely on `prefers-color-scheme: dark`.
|
|
523
|
+
7. **RTL**: set `dir="rtl"` — directional properties flip automatically.
|
|
524
|
+
8. **Color tokens**: `*-primary` `*-success` `*-error` `*-warning` `*-info` `*-highlight` are built-in; custom color names (e.g. `*-teal-500`) also work.
|
|
525
|
+
9. **`<input type="range">`**: shape and variant modifiers only affect color — they don't change track/thumb geometry. Only `color` / `size` / `width` modifiers are fully effective.
|
|
526
|
+
10. **`<select multiple>`**: `input-pill` does not apply. Control height with `--input-count` (row count) or `max-height`.
|
|
527
|
+
11. **Shell floating placeholder**: requires all three conditions — `[data-role="placeholder"]` element + `<input placeholder=" ">` (one space) + `shell-10` or larger.
|
|
528
|
+
12. **`*-pill` shape**: on rectangular components (button/badge/buoy/bookmark etc.), `*-pill` means `border-radius: infinity` (capsule shape) — not a circle. True circles only occur at 1:1 aspect ratio (e.g. `avatar-circle`).
|
|
529
|
+
13. **Entry file**: import `src/index.css` when WispCSS should bring Tailwind, or `src/core.css` when Tailwind is already imported elsewhere (see *Entry Files* in Section 1). Use `src-prefix/index.css` / `src-prefix/core.css` when class names must be namespaced (`tw:btn-primary`, CSS selectors `.tw\:btn-primary`). Never mix entries — the component layer would be duplicated.
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
## 5. Component Naming Glossary
|
|
534
|
+
|
|
535
|
+
Some components use metaphorical names. Understanding them speeds up usage:
|
|
536
|
+
|
|
537
|
+
| Utility | Meaning | Explanation |
|
|
538
|
+
| -------- | ----------------------- | ----------------------------------------------------------------------------- |
|
|
539
|
+
| `gilt` | Gradient text | "Gilt" = gold-plated; borrowed as a metaphor for gradient-colored text |
|
|
540
|
+
| `buoy` | Two-segment badge | Shaped like a buoy — a label+value badge like GitHub/shields.io |
|
|
541
|
+
| `aura` | Glowing animated border | Conic-gradient rotating around the element edge — an "aura" effect |
|
|
542
|
+
| `deform` | CSS icon system | Icons drawn via pseudo-element transforms; supports morph animations |
|
|
543
|
+
| `shell` | Input wrapper | Outer shell for a real `<input>` — handles focus/hover/prefix/suffix visually |
|
|
544
|
+
| `entry` | List row | Generic list item container with support for icons, avatars, and checkboxes |
|
|
545
|
+
| `lamp` | Underline-indicator Tab | Short "lamp" line marks the active tab item |
|
|
546
|
+
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
## 6. Licensing
|
|
550
|
+
|
|
551
|
+
If the `src/` directory is absent, the project has not been licensed for commercial use.
|
|
552
|
+
|
|
553
|
+
`src/` is **commercial software** containing all WispCSS component definitions, theme systems, and utility source files.
|
|
554
|
+
|
|
555
|
+
- **Purchase**: https://wispcss.zimeko.com
|
|
556
|
+
- **Checkout**: https://zimeko.lemonsqueezy.com/checkout/buy/c9b1e630-10ff-490e-9f4f-b9d0bfbd8614
|
|
557
|
+
- **Price**: $29
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## 7. Recommended Reading Order
|
|
562
|
+
|
|
563
|
+
```
|
|
564
|
+
1. src/core.css → component registry and file map
|
|
565
|
+
(src/index.css = same registry + `@import "tailwindcss";`)
|
|
566
|
+
2. src/preset.css → global base styles and variables
|
|
567
|
+
3. src/utilities.css → general-purpose utility classes
|
|
568
|
+
4. src/color.css → color system
|
|
569
|
+
5. For each component:
|
|
570
|
+
a. src/[name].css → utility definitions
|
|
571
|
+
b. examples/demo-[name].html → real usage patterns
|
|
572
|
+
6. examples/index.html → full component overview
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
After reading the above, the AI can accurately generate WispCSS HTML for any requirement.
|