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
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<link id="wispcss-css" rel="stylesheet" href="../dist/wispcss.css">
|
|
8
|
+
<link rel="stylesheet" href="./demo-styles.css">
|
|
9
|
+
<title>Check - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Check Component</h1>
|
|
14
|
+
<p>Modern checkbox and radio component with CSS variables and pseudo-elements.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li>Prefer combined utilities like <code>check-subtle-primary</code> over separate <code>check-subtle check-primary</code> — smaller CSS output.</li>
|
|
20
|
+
<li>Use <code>check-indeterminate</code> for semi-checked state, or the native <code>:indeterminate</code> pseudo-class.</li>
|
|
21
|
+
<li>Sizes use <code>check-4</code> ~ <code>check-15</code> (4 ~ 15 spacing units). Height increases by 1 spacing unit per step.</li>
|
|
22
|
+
<li>Shape modifiers (<code>check-pill</code>, <code>check-rounded</code>, <code>check-square</code>, <code>check-fluid</code>) apply to variants with background/border (subtle, vivid, ghost, outline, muted, tick).</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<h2 id="basic">Basic usage</h2>
|
|
27
|
+
<div class="section">
|
|
28
|
+
<div>
|
|
29
|
+
<h3>Radio</h3>
|
|
30
|
+
<label class="check"><input type="radio" name="basic-radio"><span>Option 1</span></label>
|
|
31
|
+
<label class="check"><input type="radio" name="basic-radio"><span>Option 2</span></label>
|
|
32
|
+
<label class="check check-bold"><input type="radio" name="basic-radio"><span>Bold border</span></label>
|
|
33
|
+
<label class="check"><input type="radio" name="basic-radio" checked><span>Checked</span></label>
|
|
34
|
+
<label class="check"><input type="radio" name="basic-radio" disabled><span>Disabled</span></label>
|
|
35
|
+
</div>
|
|
36
|
+
<div>
|
|
37
|
+
<h3>Checkbox</h3>
|
|
38
|
+
<label class="check"><input type="checkbox"><span>Option 1</span></label>
|
|
39
|
+
<label class="check"><input type="checkbox"><span>Option 2</span></label>
|
|
40
|
+
<label class="check check-bold"><input type="checkbox"><span>Bold border</span></label>
|
|
41
|
+
<label class="check"><input type="checkbox" checked><span>Checked</span></label>
|
|
42
|
+
<label class="check"><input type="checkbox" disabled><span>Disabled</span></label>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<h2 id="variants">Visual variants</h2>
|
|
47
|
+
<div class="section">
|
|
48
|
+
<div>
|
|
49
|
+
<h3>check-subtle</h3>
|
|
50
|
+
<p>Soft filled background.</p>
|
|
51
|
+
<label class="check check-subtle"><input type="radio" name="subtle-radio"><span>Radio</span></label>
|
|
52
|
+
<label class="check check-subtle"><input type="radio" name="subtle-radio" checked><span>Checked</span></label>
|
|
53
|
+
<label class="check check-subtle"><input type="radio" name="subtle-radio" disabled><span>Disabled</span></label>
|
|
54
|
+
<label class="check check-subtle"><input type="checkbox"><span>Checkbox</span></label>
|
|
55
|
+
<label class="check check-subtle"><input type="checkbox" checked><span>Checked</span></label>
|
|
56
|
+
<label class="check check-subtle"><input type="checkbox" disabled><span>Disabled</span></label>
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
<h3>check-vivid</h3>
|
|
60
|
+
<p>Color inversion on hover / checked.</p>
|
|
61
|
+
<label class="check check-vivid"><input type="radio" name="vivid-radio"><span>Radio</span></label>
|
|
62
|
+
<label class="check check-vivid"><input type="radio" name="vivid-radio" checked><span>Checked</span></label>
|
|
63
|
+
<label class="check check-vivid"><input type="radio" name="vivid-radio" disabled><span>Disabled</span></label>
|
|
64
|
+
<label class="check check-vivid"><input type="checkbox"><span>Checkbox</span></label>
|
|
65
|
+
<label class="check check-vivid"><input type="checkbox" checked><span>Checked</span></label>
|
|
66
|
+
<label class="check check-vivid"><input type="checkbox" disabled><span>Disabled</span></label>
|
|
67
|
+
</div>
|
|
68
|
+
<div>
|
|
69
|
+
<h3>check-ghost</h3>
|
|
70
|
+
<p>Transparent with hover background.</p>
|
|
71
|
+
<label class="check check-ghost"><input type="radio" name="ghost-radio"><span>Radio</span></label>
|
|
72
|
+
<label class="check check-ghost"><input type="radio" name="ghost-radio" checked><span>Checked</span></label>
|
|
73
|
+
<label class="check check-ghost"><input type="radio" name="ghost-radio" disabled><span>Disabled</span></label>
|
|
74
|
+
<label class="check check-ghost"><input type="checkbox"><span>Checkbox</span></label>
|
|
75
|
+
<label class="check check-ghost"><input type="checkbox" checked><span>Checked</span></label>
|
|
76
|
+
<label class="check check-ghost"><input type="checkbox" disabled><span>Disabled</span></label>
|
|
77
|
+
</div>
|
|
78
|
+
<div>
|
|
79
|
+
<h3>check-outline</h3>
|
|
80
|
+
<p>Solid border button-like.</p>
|
|
81
|
+
<label class="check check-outline"><input type="radio" name="outline-radio"><span>Radio</span></label>
|
|
82
|
+
<label class="check check-outline"><input type="radio" name="outline-radio" checked><span>Checked</span></label>
|
|
83
|
+
<label class="check check-outline"><input type="radio" name="outline-radio" disabled><span>Disabled</span></label>
|
|
84
|
+
<label class="check check-outline"><input type="checkbox"><span>Checkbox</span></label>
|
|
85
|
+
<label class="check check-outline"><input type="checkbox" checked><span>Checked</span></label>
|
|
86
|
+
<label class="check check-outline"><input type="checkbox" disabled><span>Disabled</span></label>
|
|
87
|
+
</div>
|
|
88
|
+
<div>
|
|
89
|
+
<h3>check-muted</h3>
|
|
90
|
+
<p>Soft gray border.</p>
|
|
91
|
+
<label class="check check-muted"><input type="radio" name="muted-radio"><span>Radio</span></label>
|
|
92
|
+
<label class="check check-muted"><input type="radio" name="muted-radio" checked><span>Checked</span></label>
|
|
93
|
+
<label class="check check-muted"><input type="radio" name="muted-radio" disabled><span>Disabled</span></label>
|
|
94
|
+
<label class="check check-muted"><input type="checkbox"><span>Checkbox</span></label>
|
|
95
|
+
<label class="check check-muted"><input type="checkbox" checked><span>Checked</span></label>
|
|
96
|
+
<label class="check check-muted"><input type="checkbox" disabled><span>Disabled</span></label>
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<h3>check-tick</h3>
|
|
100
|
+
<p>Checkmark icon only, no box.</p>
|
|
101
|
+
<label class="check check-tick"><input type="radio" name="tick-radio"><span>Radio</span></label>
|
|
102
|
+
<label class="check check-tick"><input type="radio" name="tick-radio" checked><span>Checked</span></label>
|
|
103
|
+
<label class="check check-tick"><input type="radio" name="tick-radio" disabled><span>Disabled</span></label>
|
|
104
|
+
<label class="check check-tick"><input type="checkbox"><span>Checkbox</span></label>
|
|
105
|
+
<label class="check check-tick"><input type="checkbox" checked><span>Checked</span></label>
|
|
106
|
+
<label class="check check-tick"><input type="checkbox" disabled><span>Disabled</span></label>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<h2 id="features">Features</h2>
|
|
111
|
+
<div class="section">
|
|
112
|
+
<div>
|
|
113
|
+
<h3>check-indeterminate</h3>
|
|
114
|
+
<label class="check check-indeterminate"><input type="checkbox"><span>Indeterminate</span></label>
|
|
115
|
+
<label class="check check-primary check-indeterminate"><input type="checkbox"><span>Primary indeterminate</span></label>
|
|
116
|
+
</div>
|
|
117
|
+
<div>
|
|
118
|
+
<h3>check-reverse</h3>
|
|
119
|
+
<p>Label on the left side.</p>
|
|
120
|
+
<label class="check check-reverse"><input type="checkbox"><span>Reverse layout</span></label>
|
|
121
|
+
</div>
|
|
122
|
+
<div>
|
|
123
|
+
<h3>check-full</h3>
|
|
124
|
+
<p>Full-width horizontal fill.</p>
|
|
125
|
+
<label class="check check-full"><input type="checkbox"><span>This option fills the parent container width.</span></label>
|
|
126
|
+
</div>
|
|
127
|
+
<div>
|
|
128
|
+
<h3>check-multiline</h3>
|
|
129
|
+
<p>Multi-line text, top-aligned with input.</p>
|
|
130
|
+
<label class="check check-multiline" style="width:300px;"><input type="checkbox"><span>This is a long multi-line option. When the text is too long it will wrap automatically to keep the layout clean and readable.</span></label>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<h2 id="shapes">Shape modifiers</h2>
|
|
135
|
+
<div class="section">
|
|
136
|
+
<div>
|
|
137
|
+
<h3>check-pill (pill)</h3>
|
|
138
|
+
<label class="check check-subtle check-pill"><input type="checkbox"><span>Circle shape</span></label>
|
|
139
|
+
<label class="check check-outline check-pill"><input type="checkbox"><span>Circle outline</span></label>
|
|
140
|
+
</div>
|
|
141
|
+
<div>
|
|
142
|
+
<h3>check-rounded (micro-rounded)</h3>
|
|
143
|
+
<label class="check check-subtle check-rounded"><input type="checkbox"><span>Rounded</span></label>
|
|
144
|
+
<label class="check check-outline check-rounded"><input type="checkbox"><span>Rounded outline</span></label>
|
|
145
|
+
</div>
|
|
146
|
+
<div>
|
|
147
|
+
<h3>check-square (sharp)</h3>
|
|
148
|
+
<label class="check check-subtle check-square"><input type="checkbox"><span>Square</span></label>
|
|
149
|
+
<label class="check check-outline check-square"><input type="checkbox"><span>Square outline</span></label>
|
|
150
|
+
</div>
|
|
151
|
+
<div>
|
|
152
|
+
<h3>check-fluid (height-proportional)</h3>
|
|
153
|
+
<label class="check check-subtle check-fluid"><input type="checkbox"><span>Fluid round</span></label>
|
|
154
|
+
<label class="check check-outline check-fluid"><input type="checkbox"><span>Fluid outline</span></label>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<h2 id="sizes">Sizes</h2>
|
|
159
|
+
<div class="section">
|
|
160
|
+
<div>
|
|
161
|
+
<h3>check-4 (16px) ~ check-7 (28px)</h3>
|
|
162
|
+
<label class="check check-subtle check-4"><input type="checkbox"><span>check-4</span></label>
|
|
163
|
+
<label class="check check-subtle check-5"><input type="checkbox"><span>check-5</span></label>
|
|
164
|
+
<label class="check check-subtle check-6"><input type="checkbox"><span>check-6</span></label>
|
|
165
|
+
<label class="check check-subtle check-7"><input type="checkbox"><span>check-7</span></label>
|
|
166
|
+
</div>
|
|
167
|
+
<div>
|
|
168
|
+
<h3>check-8 (32px) ~ check-11 (44px)</h3>
|
|
169
|
+
<label class="check check-subtle check-8"><input type="checkbox"><span>check-8</span></label>
|
|
170
|
+
<label class="check check-subtle check-9"><input type="checkbox"><span>check-9</span></label>
|
|
171
|
+
<label class="check check-subtle check-10"><input type="checkbox"><span>check-10</span></label>
|
|
172
|
+
<label class="check check-subtle check-11"><input type="checkbox"><span>check-11</span></label>
|
|
173
|
+
</div>
|
|
174
|
+
<div>
|
|
175
|
+
<h3>check-12 (48px) ~ check-15 (60px)</h3>
|
|
176
|
+
<label class="check check-subtle check-12"><input type="checkbox"><span>check-12</span></label>
|
|
177
|
+
<label class="check check-subtle check-13"><input type="checkbox"><span>check-13</span></label>
|
|
178
|
+
<label class="check check-subtle check-14"><input type="checkbox"><span>check-14</span></label>
|
|
179
|
+
<label class="check check-subtle check-15"><input type="checkbox"><span>check-15</span></label>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<h2 id="theme-colors">Theme colors</h2>
|
|
184
|
+
<div class="section">
|
|
185
|
+
<div>
|
|
186
|
+
<h3>Primary</h3>
|
|
187
|
+
<label class="check check-primary"><input type="radio" name="c-primary-radio"><span>Radio</span></label>
|
|
188
|
+
<label class="check check-primary"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
189
|
+
<label class="check check-subtle check-primary"><input type="checkbox" checked><span>Subtle</span></label>
|
|
190
|
+
<label class="check check-outline check-primary"><input type="checkbox"><span>Outline</span></label>
|
|
191
|
+
</div>
|
|
192
|
+
<div>
|
|
193
|
+
<h3>Secondary</h3>
|
|
194
|
+
<label class="check check-secondary"><input type="radio" name="c-secondary-radio"><span>Radio</span></label>
|
|
195
|
+
<label class="check check-secondary"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
196
|
+
<label class="check check-subtle check-secondary"><input type="checkbox" checked><span>Subtle</span></label>
|
|
197
|
+
<label class="check check-outline check-secondary"><input type="checkbox"><span>Outline</span></label>
|
|
198
|
+
</div>
|
|
199
|
+
<div>
|
|
200
|
+
<h3>Tertiary</h3>
|
|
201
|
+
<label class="check check-tertiary"><input type="radio" name="c-tertiary-radio"><span>Radio</span></label>
|
|
202
|
+
<label class="check check-tertiary"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
203
|
+
<label class="check check-subtle check-tertiary"><input type="checkbox" checked><span>Subtle</span></label>
|
|
204
|
+
<label class="check check-outline check-tertiary"><input type="checkbox" ><span>Outline</span></label>
|
|
205
|
+
</div>
|
|
206
|
+
<div>
|
|
207
|
+
<h3>Success</h3>
|
|
208
|
+
<label class="check check-success"><input type="radio" name="c-success-radio"><span>Radio</span></label>
|
|
209
|
+
<label class="check check-success"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
210
|
+
<label class="check check-subtle check-success"><input type="checkbox" checked><span>Subtle</span></label>
|
|
211
|
+
<label class="check check-outline check-success"><input type="checkbox" ><span>Outline</span></label>
|
|
212
|
+
</div>
|
|
213
|
+
<div>
|
|
214
|
+
<h3>Error</h3>
|
|
215
|
+
<label class="check check-error"><input type="radio" name="c-error-radio"><span>Radio</span></label>
|
|
216
|
+
<label class="check check-error"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
217
|
+
<label class="check check-subtle check-error"><input type="checkbox" checked><span>Subtle</span></label>
|
|
218
|
+
<label class="check check-outline check-error"><input type="checkbox" ><span>Outline</span></label>
|
|
219
|
+
</div>
|
|
220
|
+
<div>
|
|
221
|
+
<h3>Info</h3>
|
|
222
|
+
<label class="check check-info"><input type="radio" name="c-info-radio"><span>Radio</span></label>
|
|
223
|
+
<label class="check check-info"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
224
|
+
<label class="check check-subtle check-info"><input type="checkbox" checked><span>Subtle</span></label>
|
|
225
|
+
<label class="check check-outline check-info"><input type="checkbox" ><span>Outline</span></label>
|
|
226
|
+
</div>
|
|
227
|
+
<div>
|
|
228
|
+
<h3>Warning</h3>
|
|
229
|
+
<label class="check check-warning"><input type="radio" name="c-warning-radio"><span>Radio</span></label>
|
|
230
|
+
<label class="check check-warning"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
231
|
+
<label class="check check-subtle check-warning"><input type="checkbox" checked><span>Subtle</span></label>
|
|
232
|
+
<label class="check check-outline check-warning"><input type="checkbox" ><span>Outline</span></label>
|
|
233
|
+
</div>
|
|
234
|
+
<div>
|
|
235
|
+
<h3>Caution</h3>
|
|
236
|
+
<label class="check check-caution"><input type="radio" name="c-caution-radio"><span>Radio</span></label>
|
|
237
|
+
<label class="check check-caution"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
238
|
+
<label class="check check-subtle check-caution"><input type="checkbox" checked><span>Subtle</span></label>
|
|
239
|
+
<label class="check check-outline check-caution"><input type="checkbox" ><span>Outline</span></label>
|
|
240
|
+
</div>
|
|
241
|
+
<div>
|
|
242
|
+
<h3>Highlight</h3>
|
|
243
|
+
<label class="check check-highlight"><input type="radio" name="c-highlight-radio"><span>Radio</span></label>
|
|
244
|
+
<label class="check check-highlight"><input type="checkbox" checked><span>Checkbox</span></label>
|
|
245
|
+
<label class="check check-subtle check-highlight"><input type="checkbox" checked><span>Subtle</span></label>
|
|
246
|
+
<label class="check check-outline check-highlight"><input type="checkbox" ><span>Outline</span></label>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<h2 id="variant-shortcuts">Shortcut variant colors</h2>
|
|
251
|
+
<div class="section">
|
|
252
|
+
<p>Standalone compound variants — equivalent to variant + color in one class.</p>
|
|
253
|
+
<div>
|
|
254
|
+
<h3>check-subtle-*</h3>
|
|
255
|
+
<label class="check check-subtle-primary"><input type="checkbox" checked><span>check-subtle-primary</span></label>
|
|
256
|
+
<label class="check check-subtle-success"><input type="checkbox" checked><span>check-subtle-success</span></label>
|
|
257
|
+
<label class="check check-subtle-error"><input type="checkbox" ><span>check-subtle-error</span></label>
|
|
258
|
+
</div>
|
|
259
|
+
<div>
|
|
260
|
+
<h3>check-vivid-*</h3>
|
|
261
|
+
<label class="check check-vivid-primary"><input type="checkbox" checked><span>check-vivid-primary</span></label>
|
|
262
|
+
<label class="check check-vivid-success"><input type="checkbox" checked><span>check-vivid-success</span></label>
|
|
263
|
+
<label class="check check-vivid-error"><input type="checkbox" ><span>check-vivid-error</span></label>
|
|
264
|
+
</div>
|
|
265
|
+
<div>
|
|
266
|
+
<h3>check-ghost-*</h3>
|
|
267
|
+
<label class="check check-ghost-primary"><input type="checkbox" checked><span>check-ghost-primary</span></label>
|
|
268
|
+
<label class="check check-ghost-success"><input type="checkbox" checked><span>check-ghost-success</span></label>
|
|
269
|
+
<label class="check check-ghost-error"><input type="checkbox" ><span>check-ghost-error</span></label>
|
|
270
|
+
</div>
|
|
271
|
+
<div>
|
|
272
|
+
<h3>check-outline-*</h3>
|
|
273
|
+
<label class="check check-outline-primary"><input type="checkbox" checked><span>check-outline-primary</span></label>
|
|
274
|
+
<label class="check check-outline-success"><input type="checkbox" checked><span>check-outline-success</span></label>
|
|
275
|
+
<label class="check check-outline-error"><input type="checkbox" ><span>check-outline-error</span></label>
|
|
276
|
+
</div>
|
|
277
|
+
<div>
|
|
278
|
+
<h3>check-muted-*</h3>
|
|
279
|
+
<label class="check check-muted-primary"><input type="checkbox" checked><span>check-muted-primary</span></label>
|
|
280
|
+
<label class="check check-muted-success"><input type="checkbox" checked><span>check-muted-success</span></label>
|
|
281
|
+
<label class="check check-muted-error"><input type="checkbox" ><span>check-muted-error</span></label>
|
|
282
|
+
</div>
|
|
283
|
+
<div>
|
|
284
|
+
<h3>check-tick-*</h3>
|
|
285
|
+
<label class="check check-tick-primary"><input type="checkbox" checked><span>check-tick-primary</span></label>
|
|
286
|
+
<label class="check check-tick-success"><input type="checkbox" checked><span>check-tick-success</span></label>
|
|
287
|
+
<label class="check check-tick-error"><input type="checkbox" ><span>check-tick-error</span></label>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<h2 id="custom-colors">Custom colors</h2>
|
|
292
|
+
<div class="section">
|
|
293
|
+
<p>Multiple color formats are supported:</p>
|
|
294
|
+
<ul>
|
|
295
|
+
<li>1. Theme semantic colors, e.g. <code>*-error</code>, <code>*-error-hover</code></li>
|
|
296
|
+
<li>2. Tailwind built-in colors, e.g. <code>*-indigo-500</code></li>
|
|
297
|
+
<li>3. Raw color values, e.g. <code>*-[#ff0000]</code></li>
|
|
298
|
+
<li>4. CSS named colors, e.g. <code>*-[red]</code>, <code>*-[green]</code></li>
|
|
299
|
+
</ul>
|
|
300
|
+
<div>
|
|
301
|
+
<h3>check-blue-* custom color</h3>
|
|
302
|
+
<label class="check check-blue-100"><input type="checkbox" checked><span>check-blue-100</span></label>
|
|
303
|
+
<label class="check check-blue-500"><input type="checkbox" checked><span>check-blue-500</span></label>
|
|
304
|
+
<label class="check check-blue-800"><input type="checkbox" checked><span>check-blue-800</span></label>
|
|
305
|
+
</div>
|
|
306
|
+
<div>
|
|
307
|
+
<h3>Subtle variant with custom color</h3>
|
|
308
|
+
<label class="check check-subtle check-blue-100"><input type="checkbox" checked><span>check-blue-100 subtle</span></label>
|
|
309
|
+
<label class="check check-subtle check-blue-500"><input type="checkbox" checked><span>check-blue-500 subtle</span></label>
|
|
310
|
+
<label class="check check-subtle check-blue-800"><input type="checkbox" checked><span>check-blue-800 subtle</span></label>
|
|
311
|
+
</div>
|
|
312
|
+
<div>
|
|
313
|
+
<h3>Outline variant with custom color</h3>
|
|
314
|
+
<label class="check check-outline check-blue-100"><input type="checkbox" checked><span>check-blue-100 outline</span></label>
|
|
315
|
+
<label class="check check-outline check-blue-500"><input type="checkbox" checked><span>check-blue-500 outline</span></label>
|
|
316
|
+
<label class="check check-outline check-blue-800"><input type="checkbox" checked><span>check-blue-800 outline</span></label>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<script src="./demo-utils.js"></script>
|
|
321
|
+
</body>
|
|
322
|
+
|
|
323
|
+
</html>
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<link id="wispcss-css" rel="stylesheet" href="../dist/wispcss.css">
|
|
8
|
+
<link rel="stylesheet" href="./demo-styles.css">
|
|
9
|
+
<title>Code - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Code Component</h1>
|
|
14
|
+
<p>Inline code highlighting utilities for <code><code></code> tags with dynamic theme support.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li>Default inline code style uses a subtle background (bg-hover). No variant class needed.</li>
|
|
20
|
+
<li>Prefer combined utilities like <code>code-solid-primary</code> over separate <code>code-solid code-primary</code> — smaller CSS output.</li>
|
|
21
|
+
<li>Use <code><pre><code></code> for multi-line code blocks — <code><pre></code> preserves formatting, <code><code></code> marks semantics.</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<h2 id="basic">Basic usage</h2>
|
|
26
|
+
<div class="section">
|
|
27
|
+
<div>
|
|
28
|
+
<h3>Inline code (default subtle style)</h3>
|
|
29
|
+
<p>Variable declaration: <code>const x = 10;</code></p>
|
|
30
|
+
<p>Function call: <code>getData()</code></p>
|
|
31
|
+
<p>File path: <code>/usr/local/bin/node</code></p>
|
|
32
|
+
<p>Install: <code>npm install wispcss</code></p>
|
|
33
|
+
</div>
|
|
34
|
+
<div>
|
|
35
|
+
<h3>Code in paragraph text</h3>
|
|
36
|
+
<p>Run <code>npm install</code> in your terminal to install dependencies.</p>
|
|
37
|
+
<p>Use <code>git commit -m "message"</code> to commit changes.</p>
|
|
38
|
+
<p>Config file is at <code>~/.config/wispcss/config.json</code>.</p>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<h2 id="variants">Visual variants</h2>
|
|
43
|
+
<div class="section">
|
|
44
|
+
<div>
|
|
45
|
+
<h3>code-plain</h3>
|
|
46
|
+
<p>Removes background, padding and border-radius. Uses current text color.</p>
|
|
47
|
+
<p><code class="code-primary code-plain">code-plain</code> — no background</p>
|
|
48
|
+
</div>
|
|
49
|
+
<div>
|
|
50
|
+
<h3>code-muted</h3>
|
|
51
|
+
<p>Subtle semi-transparent border with background.</p>
|
|
52
|
+
<p><code class="code-secondary code-muted">code-muted</code> — light border</p>
|
|
53
|
+
</div>
|
|
54
|
+
<div>
|
|
55
|
+
<h3>code-outline</h3>
|
|
56
|
+
<p>Solid border matching the theme color.</p>
|
|
57
|
+
<p><code class="code-tertiary code-outline">code-outline</code> — solid border</p>
|
|
58
|
+
</div>
|
|
59
|
+
<div>
|
|
60
|
+
<h3>code-solid</h3>
|
|
61
|
+
<p>Solid filled background with white text.</p>
|
|
62
|
+
<p><code class="code-solid">code-solid</code> — dark background</p>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<h2 id="theme-colors">Theme colors</h2>
|
|
67
|
+
<div class="section">
|
|
68
|
+
<div>
|
|
69
|
+
<h3>Primary / Secondary / Tertiary</h3>
|
|
70
|
+
<p><code class="code-primary">primary</code> — theme primary</p>
|
|
71
|
+
<p><code class="code-secondary">secondary</code> — theme secondary</p>
|
|
72
|
+
<p><code class="code-tertiary">tertiary</code> — theme tertiary</p>
|
|
73
|
+
</div>
|
|
74
|
+
<div>
|
|
75
|
+
<h3>Status colors</h3>
|
|
76
|
+
<p><code class="code-success">success</code> — success state</p>
|
|
77
|
+
<p><code class="code-error">error</code> — error state</p>
|
|
78
|
+
<p><code class="code-info">info</code> — info state</p>
|
|
79
|
+
<p><code class="code-warning">warning</code> — warning state</p>
|
|
80
|
+
<p><code class="code-caution">caution</code> — caution state</p>
|
|
81
|
+
</div>
|
|
82
|
+
<div>
|
|
83
|
+
<h3>Highlight / Ink</h3>
|
|
84
|
+
<p><code class="code-highlight">highlight</code> — highlight emphasis</p>
|
|
85
|
+
<p><code class="code-ink">ink</code> — neutral ink</p>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<h2 id="variant-shortcuts">Shortcut variant colors</h2>
|
|
90
|
+
<div class="section">
|
|
91
|
+
<p>Standalone compound variants — equivalent to variant + color in one class.</p>
|
|
92
|
+
<div>
|
|
93
|
+
<h3>code-muted-*</h3>
|
|
94
|
+
<p><code class="code-muted-primary">code-muted-primary</code></p>
|
|
95
|
+
<p><code class="code-muted-success">code-muted-success</code></p>
|
|
96
|
+
<p><code class="code-muted-error">code-muted-error</code></p>
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<h3>code-outline-*</h3>
|
|
100
|
+
<p><code class="code-outline-primary">code-outline-primary</code></p>
|
|
101
|
+
<p><code class="code-outline-success">code-outline-success</code></p>
|
|
102
|
+
<p><code class="code-outline-error">code-outline-error</code></p>
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<h3>code-solid-*</h3>
|
|
106
|
+
<p><code class="code-solid-primary">code-solid-primary</code></p>
|
|
107
|
+
<p><code class="code-solid-success">code-solid-success</code></p>
|
|
108
|
+
<p><code class="code-solid-error">code-solid-error</code></p>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<h2 id="custom-colors">Custom colors</h2>
|
|
113
|
+
<div class="section">
|
|
114
|
+
<p>Multiple color formats are supported:</p>
|
|
115
|
+
<ul>
|
|
116
|
+
<li>1. Theme semantic colors, e.g. <code>*-error</code>, <code>*-error-hover</code></li>
|
|
117
|
+
<li>2. Tailwind built-in colors, e.g. <code>*-indigo-500</code></li>
|
|
118
|
+
<li>3. Raw color values, e.g. <code>*-[#ff0000]</code></li>
|
|
119
|
+
<li>4. CSS named colors, e.g. <code>*-[red]</code>, <code>*-[green]</code></li>
|
|
120
|
+
</ul>
|
|
121
|
+
<div>
|
|
122
|
+
<p><code class="code-blue-200">blue-200</code></p>
|
|
123
|
+
<p><code class="code-blue-500">blue-500</code></p>
|
|
124
|
+
<p><code class="code-[#ff0000]">[#ff0000]</code> — raw color value</p>
|
|
125
|
+
<p><code class="code-solid-[#ff0000]">code-solid-[#ff0000]</code> — solid with raw color</p>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<h2 id="use-cases">Use cases</h2>
|
|
130
|
+
<div class="section">
|
|
131
|
+
<div>
|
|
132
|
+
<h3>Error logs and messages</h3>
|
|
133
|
+
<p><code class="code-error">ERROR</code> TypeError: Cannot read property 'x' of undefined</p>
|
|
134
|
+
<p><code class="code-warning">WARN</code> Deprecated: use new API instead</p>
|
|
135
|
+
<p><code class="code-info">INFO</code> Server started on port 3000</p>
|
|
136
|
+
<p><code class="code-success">SUCCESS</code> Build completed successfully!</p>
|
|
137
|
+
</div>
|
|
138
|
+
<div>
|
|
139
|
+
<h3>Documentation references</h3>
|
|
140
|
+
<p>Type: <code>type User = { id: number; name: string }</code></p>
|
|
141
|
+
<p>Interface: <code>interface Config { theme: string }</code></p>
|
|
142
|
+
<p>Generic: <code>Array<T></code></p>
|
|
143
|
+
<p>Regex: <code>/^[a-zA-Z0-9]+$/</code></p>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<h2 id="pre-plus-code-blocks">Pre + code blocks</h2>
|
|
148
|
+
<div class="section">
|
|
149
|
+
<div>
|
|
150
|
+
<h3>JavaScript</h3>
|
|
151
|
+
<pre><code>function fibonacci(n) {
|
|
152
|
+
if (n <= 1) return n;
|
|
153
|
+
return fibonacci(n - 1) + fibonacci(n - 2);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
console.log(fibonacci(10)); // 55</code></pre>
|
|
157
|
+
</div>
|
|
158
|
+
<div>
|
|
159
|
+
<h3>Python</h3>
|
|
160
|
+
<pre><code>def fibonacci(n):
|
|
161
|
+
if n <= 1:
|
|
162
|
+
return n
|
|
163
|
+
return fibonacci(n - 1) + fibonacci(n - 2)
|
|
164
|
+
|
|
165
|
+
print(fibonacci(10)) # 55</code></pre>
|
|
166
|
+
</div>
|
|
167
|
+
<div>
|
|
168
|
+
<h3>HTML</h3>
|
|
169
|
+
<pre><code><!DOCTYPE html>
|
|
170
|
+
<html lang="en">
|
|
171
|
+
<head>
|
|
172
|
+
<meta charset="UTF-8">
|
|
173
|
+
<title>Example</title>
|
|
174
|
+
</head>
|
|
175
|
+
<body>
|
|
176
|
+
<h1>Hello World</h1>
|
|
177
|
+
</body>
|
|
178
|
+
</html></code></pre>
|
|
179
|
+
</div>
|
|
180
|
+
<div>
|
|
181
|
+
<h3>CSS</h3>
|
|
182
|
+
<pre><code>.container {
|
|
183
|
+
max-width: 1400px;
|
|
184
|
+
margin: 0 auto;
|
|
185
|
+
padding: 2rem;
|
|
186
|
+
background: #fff;
|
|
187
|
+
border-radius: 8px;
|
|
188
|
+
box-shadow: 0 2px 8px rgba(0,0,0,.1);
|
|
189
|
+
}</code></pre>
|
|
190
|
+
</div>
|
|
191
|
+
<div>
|
|
192
|
+
<h3>Long line (horizontal scroll)</h3>
|
|
193
|
+
<pre><code>const veryLongFunctionName = (param1, param2, param3, param4, param5, param6) => {
|
|
194
|
+
return param1 + param2 + param3 + param4 + param5 + param6;
|
|
195
|
+
};</code></pre>
|
|
196
|
+
</div>
|
|
197
|
+
<div>
|
|
198
|
+
<h3>Log output</h3>
|
|
199
|
+
<pre><code>[2026-06-13 17:00:00] INFO Starting server...
|
|
200
|
+
[2026-06-13 17:00:01] INFO Server listening on port 3000
|
|
201
|
+
[2026-06-13 17:00:02] WARN Deprecated configuration option detected
|
|
202
|
+
[2026-06-13 17:00:03] ERROR Failed to connect to database
|
|
203
|
+
[2026-06-13 17:00:04] INFO Retrying connection...</code></pre>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<p style="margin-top: 2rem;">For <code>pre</code> block utilities, see <a class="link" href="./demo-pre.html">demo-pre.html</a>.</p>
|
|
208
|
+
|
|
209
|
+
<script src="./demo-utils.js"></script>
|
|
210
|
+
</body>
|
|
211
|
+
|
|
212
|
+
</html>
|