wispcss 0.0.1 → 1.0.4

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 (96) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/LICENSE +49 -0
  3. package/README.md +386 -0
  4. package/README.zh-CN.md +385 -0
  5. package/dist/wispcss.css +45823 -0
  6. package/dist/wispcss.min.css +2 -0
  7. package/examples/add-h2-ids.cjs +284 -0
  8. package/examples/demo-actions.html +188 -0
  9. package/examples/demo-alarm.html +219 -0
  10. package/examples/demo-animation.html +399 -0
  11. package/examples/demo-aura.html +195 -0
  12. package/examples/demo-avatar.html +279 -0
  13. package/examples/demo-background.html +284 -0
  14. package/examples/demo-badge.html +398 -0
  15. package/examples/demo-blob.html +307 -0
  16. package/examples/demo-blockquote.html +190 -0
  17. package/examples/demo-bookmark.html +243 -0
  18. package/examples/demo-breadcrumb.html +179 -0
  19. package/examples/demo-btns.html +349 -0
  20. package/examples/demo-bubble.html +215 -0
  21. package/examples/demo-buoy.html +187 -0
  22. package/examples/demo-button-icon.html +231 -0
  23. package/examples/demo-button-link.html +177 -0
  24. package/examples/demo-button.html +361 -0
  25. package/examples/demo-callout.html +601 -0
  26. package/examples/demo-check.html +323 -0
  27. package/examples/demo-code.html +212 -0
  28. package/examples/demo-color.html +545 -0
  29. package/examples/demo-comment.html +510 -0
  30. package/examples/demo-deform.html +229 -0
  31. package/examples/demo-dialog.html +932 -0
  32. package/examples/demo-divider.html +208 -0
  33. package/examples/demo-drawer.html +623 -0
  34. package/examples/demo-dropmenu.html +382 -0
  35. package/examples/demo-droppanel.html +354 -0
  36. package/examples/demo-ellipsis.html +145 -0
  37. package/examples/demo-emphasis.html +146 -0
  38. package/examples/demo-empty.html +112 -0
  39. package/examples/demo-entry.html +219 -0
  40. package/examples/demo-field.html +359 -0
  41. package/examples/demo-file.html +206 -0
  42. package/examples/demo-flag.html +225 -0
  43. package/examples/demo-form.html +201 -0
  44. package/examples/demo-gilt.html +170 -0
  45. package/examples/demo-heading.html +93 -0
  46. package/examples/demo-icon.html +164 -0
  47. package/examples/demo-input.html +300 -0
  48. package/examples/demo-kbd.html +202 -0
  49. package/examples/demo-lamp.html +248 -0
  50. package/examples/demo-link.html +142 -0
  51. package/examples/demo-normalize.html +366 -0
  52. package/examples/demo-otp.html +277 -0
  53. package/examples/demo-pagination.html +562 -0
  54. package/examples/demo-position.html +205 -0
  55. package/examples/demo-poster.html +384 -0
  56. package/examples/demo-pre - /345/211/257/346/234/254.html" +169 -0
  57. package/examples/demo-pre.html +205 -0
  58. package/examples/demo-preset.html +344 -0
  59. package/examples/demo-progress.html +303 -0
  60. package/examples/demo-range.html +211 -0
  61. package/examples/demo-rank.html +270 -0
  62. package/examples/demo-rating.html +251 -0
  63. package/examples/demo-reset.html +105 -0
  64. package/examples/demo-segment.html +436 -0
  65. package/examples/demo-select.html +332 -0
  66. package/examples/demo-shadow.html +152 -0
  67. package/examples/demo-shell.html +377 -0
  68. package/examples/demo-shimmer.html +217 -0
  69. package/examples/demo-size.html +149 -0
  70. package/examples/demo-skeleton.html +143 -0
  71. package/examples/demo-sketch.html +213 -0
  72. package/examples/demo-spacer.html +150 -0
  73. package/examples/demo-spinner.html +220 -0
  74. package/examples/demo-stats.html +165 -0
  75. package/examples/demo-status.html +212 -0
  76. package/examples/demo-step.html +240 -0
  77. package/examples/demo-styles.css +14 -0
  78. package/examples/demo-summary.html +128 -0
  79. package/examples/demo-swatch.html +253 -0
  80. package/examples/demo-switch.html +223 -0
  81. package/examples/demo-table.html +339 -0
  82. package/examples/demo-tag.html +318 -0
  83. package/examples/demo-text.html +91 -0
  84. package/examples/demo-theme.html +167 -0
  85. package/examples/demo-tools.html +152 -0
  86. package/examples/demo-transition.html +169 -0
  87. package/examples/demo-tree.html +929 -0
  88. package/examples/demo-underline.html +76 -0
  89. package/examples/demo-utils.js +131 -0
  90. package/examples/demo-validate.html +120 -0
  91. package/examples/index.html +149 -0
  92. package/package.json +72 -8
  93. package/script-gen-color.js +148 -0
  94. package/script-mini.js +78 -0
  95. package/script-prefix.js +398 -0
  96. package/skill.md +575 -0
@@ -0,0 +1,354 @@
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>Droppanel - WispCSS Demo</title>
10
+ <style>
11
+ .panel-content {
12
+ padding: 16px;
13
+ min-width: 300px;
14
+ }
15
+
16
+ .demo-area {
17
+ min-height: 320px;
18
+ display: flex;
19
+ align-items: flex-start;
20
+ gap: 32px;
21
+ flex-wrap: wrap;
22
+ }
23
+ </style>
24
+ </head>
25
+
26
+ <body>
27
+ <h1>Droppanel Component</h1>
28
+ <p>Pure CSS dropdown panel with fully customizable content. Supports hover/click toggle, inline mode, multiple
29
+ positions, and custom panel content.</p>
30
+
31
+ <h2>Notes</h2>
32
+ <div class="section">
33
+ <ul>
34
+ <li>Base class: <code>.droppanel</code>. Structure:
35
+ <code>droppanel > label/span/host > [data-role="panel"]</code>.</li>
36
+ <li>Panel content is fully customizable — use <code>&lt;div data-role="panel"></code> as container.</li>
37
+ <li>Hover expands by default. Use <code>label > input[type=checkbox]</code> for click toggle.</li>
38
+ <li>Use <code>.droppanel-inline</code> for inline expansion (content pushes siblings).</li>
39
+ <li>Use <code>data-role="host"</code> on trigger for arrow indicator. Use <code>data-expanded="true"</code> for
40
+ persistent open.</li>
41
+ <li>Positions: <code>.droppanel-bottom-*</code>, <code>.droppanel-top-*</code>, <code>.droppanel-end-*</code>,
42
+ <code>.droppanel-start-*</code></li>
43
+ <li>Combine with <code>.bubble</code> class on the panel element for bubble-style appearance.</li>
44
+ </ul>
45
+ </div>
46
+
47
+ <h2 id="basic">Basic usage</h2>
48
+ <div class="section">
49
+ <div>
50
+ <h3>Hover (default)</h3>
51
+ <div class="droppanel">
52
+ <span>Notifications</span>
53
+ <div data-role="panel">
54
+ <div class="panel-content">
55
+ <h4>Notifications</h4>
56
+ <ul class="panel-list">
57
+ <li>System maintenance tonight 22:00</li>
58
+ <li>You have 3 unread messages</li>
59
+ <li>Document review completed</li>
60
+ <li>v2.5.0 released</li>
61
+ </ul>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+
67
+ <div>
68
+ <h3>With arrow (data-role="host")</h3>
69
+ <div class="droppanel">
70
+ <span data-role="host">Notifications</span>
71
+ <div data-role="panel">
72
+ <div class="panel-content">
73
+ <h4>Notifications</h4>
74
+ <ul class="panel-list">
75
+ <li>System maintenance tonight 22:00</li>
76
+ <li>You have 3 unread messages</li>
77
+ <li>Document review completed</li>
78
+ <li>v2.5.0 released</li>
79
+ </ul>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </div>
84
+
85
+ <div>
86
+ <h3>Inline mode (.droppanel-inline)</h3>
87
+ <div class="droppanel droppanel-inline">
88
+ <span>Notifications</span>
89
+ <div data-role="panel">
90
+ <div class="panel-content">
91
+ <h4>Notifications</h4>
92
+ <ul class="panel-list">
93
+ <li>System maintenance tonight 22:00</li>
94
+ <li>You have 3 unread messages</li>
95
+ </ul>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ <p>This content gets pushed down.</p>
100
+ </div>
101
+
102
+ <div>
103
+ <h3>Click toggle (checkbox)</h3>
104
+ <div class="droppanel droppanel-bottom-start">
105
+ <label>User Center <input type="checkbox"></label>
106
+ <div data-role="panel">
107
+ <div class="panel-content">
108
+ <div class="panel-info">
109
+ <div class="avatar">👤</div>
110
+ <div class="info-text">
111
+ <div class="name">Zhang San</div>
112
+ <div class="desc">zhangsan@example.com</div>
113
+ </div>
114
+ </div>
115
+ <div class="panel-stats">
116
+ <div class="stat-item">
117
+ <div class="num">128</div>
118
+ <div class="label">Posts</div>
119
+ </div>
120
+ <div class="stat-item">
121
+ <div class="num">56</div>
122
+ <div class="label">Following</div>
123
+ </div>
124
+ <div class="stat-item">
125
+ <div class="num">1.2k</div>
126
+ <div class="label">Followers</div>
127
+ </div>
128
+ </div>
129
+ <div class="panel-actions">
130
+ <button class="primary">Profile</button>
131
+ <button>Logout</button>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ </div>
137
+
138
+ <div>
139
+ <h3>Expanded (data-expanded="true")</h3>
140
+ <div class="droppanel" data-expanded="true">
141
+ <span>Quick Actions</span>
142
+ <div data-role="panel">
143
+ <div class="panel-content">
144
+ <div>
145
+ <button class="primary">New Document</button>
146
+ <button>Upload File</button>
147
+ </div>
148
+ <p></p>
149
+ <div class="shell">
150
+ <label>Quick Search</label>
151
+ <input type="text" placeholder="Enter search keyword...">
152
+ </div>
153
+
154
+ </div>
155
+ </div>
156
+ </div>
157
+ </div>
158
+ </div>
159
+
160
+ <h2 id="popup-positions">Popup positions</h2>
161
+ <div class="section">
162
+ <div>
163
+ <h3>Bottom</h3>
164
+ <div class="droppanel"><span>Center</span>
165
+ <div data-role="panel">
166
+ <div class="panel-content">
167
+ <p>Bottom center</p>
168
+ </div>
169
+ </div>
170
+ </div>
171
+ <div class="droppanel droppanel-bottom-start"><span>Start</span>
172
+ <div data-role="panel">
173
+ <div class="panel-content">
174
+ <p>Bottom start</p>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ <div class="droppanel droppanel-bottom-end"><span>End</span>
179
+ <div data-role="panel">
180
+ <div class="panel-content">
181
+ <p>Bottom end</p>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ </div>
186
+ <div>
187
+ <h3>Top</h3>
188
+ <div class="droppanel droppanel-top"><span>Center</span>
189
+ <div data-role="panel">
190
+ <div class="panel-content">
191
+ <p>Top center</p>
192
+ </div>
193
+ </div>
194
+ </div>
195
+ <div class="droppanel droppanel-top-start"><span>Start</span>
196
+ <div data-role="panel">
197
+ <div class="panel-content">
198
+ <p>Top start</p>
199
+ </div>
200
+ </div>
201
+ </div>
202
+ <div class="droppanel droppanel-top-end"><span>End</span>
203
+ <div data-role="panel">
204
+ <div class="panel-content">
205
+ <p>Top end</p>
206
+ </div>
207
+ </div>
208
+ </div>
209
+ </div>
210
+ <div>
211
+ <h3>End (right)</h3>
212
+ <div class="droppanel droppanel-end"><span>Center</span>
213
+ <div data-role="panel">
214
+ <div class="panel-content">
215
+ <p>End center</p>
216
+ </div>
217
+ </div>
218
+ </div>
219
+ <div class="droppanel droppanel-end-top"><span>Top</span>
220
+ <div data-role="panel">
221
+ <div class="panel-content">
222
+ <p>End top</p>
223
+ </div>
224
+ </div>
225
+ </div>
226
+ <div class="droppanel droppanel-end-bottom"><span>Bottom</span>
227
+ <div data-role="panel">
228
+ <div class="panel-content">
229
+ <p>End bottom</p>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ </div>
234
+ <div>
235
+ <h3>Start (left)</h3>
236
+ <div class="droppanel droppanel-start"><span>Center</span>
237
+ <div data-role="panel">
238
+ <div class="panel-content">
239
+ <p>Start center</p>
240
+ </div>
241
+ </div>
242
+ </div>
243
+ <div class="droppanel droppanel-start-top"><span>Top</span>
244
+ <div data-role="panel">
245
+ <div class="panel-content">
246
+ <p>Start top</p>
247
+ </div>
248
+ </div>
249
+ </div>
250
+ <div class="droppanel droppanel-start-bottom"><span>Bottom</span>
251
+ <div data-role="panel">
252
+ <div class="panel-content">
253
+ <p>Start bottom</p>
254
+ </div>
255
+ </div>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+ <h2 id="panel-content">Panel content examples</h2>
261
+ <div class="section">
262
+ <div>
263
+ <h3>Notification list</h3>
264
+ <div class="droppanel droppanel-bottom-start">
265
+ <span>🔔 Notifications</span>
266
+ <div data-role="panel">
267
+ <div class="panel-content" style="width:280px;">
268
+ <h4>Notifications</h4>
269
+ <ul class="panel-list">
270
+ <li>System maintenance tonight 22:00</li>
271
+ <li>You have 3 unread messages</li>
272
+ </ul>
273
+ </div>
274
+ </div>
275
+ </div>
276
+ </div>
277
+ <div>
278
+ <h3>User info</h3>
279
+ <div class="droppanel droppanel-bottom-start">
280
+ <span>👤 Profile</span>
281
+ <div data-role="panel">
282
+ <div class="panel-content" style="width:260px;">
283
+ <div class="panel-info">
284
+ <div class="avatar">M</div>
285
+ <ul>
286
+ <li>Zhang San</li>
287
+ <li>zhangsan@example.com</li>
288
+ </ul>
289
+ </div>
290
+ <div>
291
+ <button class="primary">Profile</button>
292
+ <button>Logout</button>
293
+ </div>
294
+ </div>
295
+ </div>
296
+ </div>
297
+ </div>
298
+ <div>
299
+ <h3>Search panel</h3>
300
+ <div class="droppanel droppanel-bottom-start">
301
+ <span>🔍 Search</span>
302
+ <div data-role="panel">
303
+ <div class="panel-content" style="width:260px;">
304
+ <div class="shell">
305
+ <label>Keyword</label>
306
+ <input type="text" placeholder="Enter search keyword...">
307
+ </div>
308
+ <div class="panel-actions" style="margin-top:12px;">
309
+ <button class="primary">Search</button>
310
+ <button>Advanced</button>
311
+ </div>
312
+ </div>
313
+ </div>
314
+ </div>
315
+ </div>
316
+ <div>
317
+ <h3>Quick actions</h3>
318
+ <div class="droppanel droppanel-bottom-start">
319
+ <span>⚡ Actions</span>
320
+ <div data-role="panel">
321
+ <div class="panel-content" style="width:240px;">
322
+ <ul class="panel-list">
323
+ <li>System maintenance tonight 22:00</li>
324
+ <li>You have 3 unread messages</li>
325
+ </ul>
326
+ </div>
327
+ </div>
328
+ </div>
329
+ </div>
330
+ </div>
331
+
332
+ <h2 id="with-bubble">With bubble</h2>
333
+ <div class="section">
334
+ <div>
335
+ <h3>Notifications with bubble style</h3>
336
+ <div class="droppanel droppanel-bottom-start">
337
+ <span>🔔 Notifications</span>
338
+ <div data-role="panel" class="bubble bubble-top-start">
339
+ <div class="panel-content" style="width:280px;">
340
+ <h4>Notifications</h4>
341
+ <ul class="panel-list">
342
+ <li>System maintenance tonight 22:00</li>
343
+ <li>You have 3 unread messages</li>
344
+ </ul>
345
+ </div>
346
+ </div>
347
+ </div>
348
+ </div>
349
+ </div>
350
+
351
+ <script src="./demo-utils.js"></script>
352
+ </body>
353
+
354
+ </html>
@@ -0,0 +1,145 @@
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>Ellipsis - WispCSS Demo</title>
10
+ <style>
11
+ .demo-box {
12
+ width: 300px;
13
+ padding: 12px 16px;
14
+ border-radius: 8px;
15
+ border: 1px dashed var(--color-title-bd);
16
+ background: var(--color-title-bg-hover);
17
+ }
18
+ @media (max-width: 768px) { .demo-box { width: 100%; } }
19
+ </style>
20
+ </head>
21
+
22
+ <body>
23
+ <h1>Ellipsis Component</h1>
24
+ <p>Text truncation utilities: single-line, multi-line, fadeout, reserved height, and cancel truncation.</p>
25
+
26
+ <h2>Notes</h2>
27
+ <div class="section">
28
+ <ul>
29
+ <li>Single line: <code>.ellipsis</code> or <code>.ellipsis-1</code>.</li>
30
+ <li>Multi-line: <code>.ellipsis-2</code> ~ <code>.ellipsis-10</code> (2 to 10 lines).</li>
31
+ <li>Fadeout: <code>.ellipsis-fadeout</code> — bottom gradient mask for soft visual fade. Combine with multi-line classes.</li>
32
+ <li>Reserve height: <code>.ellipsis-reserve</code> — keeps fixed height even when content is shorter than the limit.</li>
33
+ <li>Cancel: <code>.ellipsis-none</code> — removes truncation for "expand full text" scenarios.</li>
34
+ </ul>
35
+ </div>
36
+
37
+ <h2 id="single-line">Single line</h2>
38
+ <div class="section">
39
+ <div>
40
+ <h3>.ellipsis</h3>
41
+ <div class="demo-box">
42
+ <div class="ellipsis">This is a long text that will be truncated with an ellipsis because its length exceeds the container width.</div>
43
+ </div>
44
+ </div>
45
+ <div>
46
+ <h3>.ellipsis-1 (alias)</h3>
47
+ <div class="demo-box">
48
+ <div class="ellipsis-1">Same single-line truncation, different class name. Works identically to .ellipsis.</div>
49
+ </div>
50
+ </div>
51
+ <div>
52
+ <h3>Real-world: file name + path</h3>
53
+ <div class="demo-box">
54
+ <div><strong>File:</strong> <span class="ellipsis" style="display:inline-block;max-width:200px;vertical-align:bottom;">2026_Q1_Financial_Report_Final_Approved.pdf</span></div>
55
+ <div><strong>Path:</strong> <span class="ellipsis" style="display:inline-block;max-width:200px;vertical-align:bottom;">/documents/finance/2026/Q1/reports/final/</span></div>
56
+ </div>
57
+ </div>
58
+ </div>
59
+
60
+ <h2 id="multi-line">Multi-line (.ellipsis-2 ~ .ellipsis-10)</h2>
61
+ <div class="section">
62
+ <div>
63
+ <h3>2 lines</h3>
64
+ <div class="demo-box">
65
+ <div class="ellipsis-2">This is a two-line truncation demo. When text exceeds two lines, the rest is cut off and an ellipsis is shown. This keeps the layout tidy and is very useful for card summaries and article lists.</div>
66
+ </div>
67
+ </div>
68
+ <div>
69
+ <h3>3 lines</h3>
70
+ <div class="demo-box">
71
+ <div class="ellipsis-3">Three-line truncation demo. Shows more content than two lines, suitable for longer previews. Ideal for blog excerpts, product descriptions, and news snippets where more context is needed.</div>
72
+ </div>
73
+ </div>
74
+ <div>
75
+ <h3>4 lines</h3>
76
+ <div class="demo-box">
77
+ <div class="ellipsis-4">Four-line truncation demo. Provides substantial preview content. Good for blog articles, longer descriptions, or any scenario where you want to show a meaningful amount of text before the cut-off.</div>
78
+ </div>
79
+ </div>
80
+ <div>
81
+ <h3>8 lines (example)</h3>
82
+ <div class="demo-box">
83
+ <div class="ellipsis-8">Eight-line truncation demo. The ellipsis component supports 2 to 10 lines, accommodating various layout needs. Choose the right line count to balance information display and space usage. For very long previews, 8 lines or more can be effective. This text is long enough to demonstrate the truncation at this line count.</div>
84
+ </div>
85
+ </div>
86
+ </div>
87
+
88
+ <h2 id="fadeout">Fadeout (.ellipsis-fadeout)</h2>
89
+ <div class="section">
90
+ <div>
91
+ <h3>With 4 lines</h3>
92
+ <div class="demo-box">
93
+ <div class="ellipsis-4 ellipsis-fadeout">Soft gradient fadeout mask at the bottom. Unlike the standard ellipsis, this creates a natural fading effect that looks more elegant. Combine with multi-line classes for both truncation and visual fade. Ideal for modern UI designs where a softer visual treatment is desired.</div>
94
+ </div>
95
+ </div>
96
+ <div>
97
+ <h3>With 3 lines</h3>
98
+ <div class="demo-box">
99
+ <div class="ellipsis-3 ellipsis-fadeout">Three-line fadeout effect. The text appears to fade out naturally at the bottom, creating a smoother visual experience compared to a hard ellipsis cut-off.</div>
100
+ </div>
101
+ </div>
102
+ </div>
103
+
104
+ <h2 id="reserve">Reserve height (.ellipsis-reserve)</h2>
105
+ <div class="section">
106
+ <div>
107
+ <h3>Short content with reserved height</h3>
108
+ <div class="demo-box">
109
+ <div class="ellipsis-4 ellipsis-reserve">Short text that doesn't fill 4 lines.</div>
110
+ </div>
111
+ </div>
112
+ <div>
113
+ <h3>Short content without reserve (collapsed)</h3>
114
+ <div class="demo-box">
115
+ <div class="ellipsis-4">Short text — height collapses to actual content.</div>
116
+ </div>
117
+ </div>
118
+ <div>
119
+ <h3>Reserve + fadeout</h3>
120
+ <div class="demo-box">
121
+ <div class="ellipsis-4 ellipsis-reserve ellipsis-fadeout">Even with short content, the container keeps 4-line height with fadeout effect. Useful for consistent card layouts.</div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+
126
+ <h2 id="cancel">Cancel (.ellipsis-none)</h2>
127
+ <div class="section">
128
+ <div>
129
+ <h3>Truncated</h3>
130
+ <div class="demo-box">
131
+ <div class="ellipsis-2">This text is truncated at 2 lines. When text exceeds the limit, the rest is cut off and an ellipsis is shown.</div>
132
+ </div>
133
+ </div>
134
+ <div>
135
+ <h3>With .ellipsis-none (full text)</h3>
136
+ <div class="demo-box">
137
+ <div class="ellipsis-2 ellipsis-none">This text also has ellipsis-2 but with ellipsis-none the truncation is cancelled. The full text is displayed, undoing the multi-line clamp. Useful for "expand full text" interactions.</div>
138
+ </div>
139
+ </div>
140
+ </div>
141
+
142
+ <script src="./demo-utils.js"></script>
143
+ </body>
144
+
145
+ </html>
@@ -0,0 +1,146 @@
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>Emphasis - WispCSS Demo</title>
10
+ </head>
11
+
12
+ <body>
13
+ <h1>Emphasis Component</h1>
14
+ <p>East Asian emphasis marks for <code>&lt;em></code> tags. Supports position (bottom/top), style variants (dot,
15
+ double-circle, triangle, sesame), open/filled, and dynamic colors.</p>
16
+
17
+ <h2>Notes</h2>
18
+ <div class="section">
19
+ <ul>
20
+ <li>Works automatically on <code>&lt;em&gt;</code> tags for languages without italic tradition (e.g.,
21
+ <code>lang="zh"</code>, <code>lang="ja"</code>, <code>lang="ko"</code>, <code>lang="hi"</code>,
22
+ <code>lang="th"</code>, <code>lang="ar"</code>).</li>
23
+ <li>Manual classes: <code>.emphasis-bottom</code> (force below), <code>.emphasis-top</code> (force above).</li>
24
+ <li>Style variants: <code>.emphasis-dot</code>, <code>.emphasis-double-circle</code>,
25
+ <code>.emphasis-triangle</code>, <code>.emphasis-sesame</code>.</li>
26
+ <li>Fill: <code>.emphasis-open</code> for hollow outlines. Combine with style variants.</li>
27
+ <li>Color: <code>emphasis-*</code> dynamic utilities (e.g. <code>emphasis-error</code>,
28
+ <code>emphasis-green-500</code>).</li>
29
+ </ul>
30
+ </div>
31
+
32
+ <h2 id="auto-detection">Language auto-detection</h2>
33
+ <div class="section">
34
+ <div>
35
+ <h3>Chinese (zh)</h3>
36
+ <p lang="zh">This text uses <em>emphasis tag</em>. In horizontal Chinese, it appears as bold by default.</p>
37
+ </div>
38
+ <div>
39
+ <h3>Japanese (ja)</h3>
40
+ <p lang="ja">Here <em>bouten (emphasis)</em> is used. In horizontal Japanese, marks appear <em>above</em> the
41
+ text.</p>
42
+ </div>
43
+ <div>
44
+ <h3>Korean (ko)</h3>
45
+ <p lang="ko">This sentence uses an <em>emphasis tag</em>. In horizontal writing, it is typically displayed in
46
+ bold.</p>
47
+ </div>
48
+ <div>
49
+ <h3>Arabic (ar)</h3>
50
+ <p lang="ar" dir="rtl">This text uses the <em>emphasis tag</em>. In horizontal formatting, it is usually displayed
51
+ in bold.</p>
52
+ </div>
53
+ <div>
54
+ <h3>Hindi (hi)</h3>
55
+ <p lang="hi">This text uses an <em>emphasis tag</em>. In horizontal writing, it is typically displayed in bold.
56
+ </p>
57
+ </div>
58
+ </div>
59
+
60
+ <h2 id="manual-classes">Manual classes</h2>
61
+ <div class="section">
62
+ <div>
63
+ <h3>.emphasis-bottom</h3>
64
+ <p><span class="emphasis-bottom">Force emphasis marks below text.</span></p>
65
+ </div>
66
+ <div>
67
+ <h3>.emphasis-top</h3>
68
+ <p><span class="emphasis-top">Force emphasis marks above text.</span></p>
69
+ </div>
70
+ </div>
71
+
72
+ <h2 id="style-variants">Style variants</h2>
73
+ <div class="section">
74
+ <div>
75
+ <h3>.emphasis-dot</h3>
76
+ <p><span class="emphasis-bottom emphasis-dot">Dot emphasis marks</span></p>
77
+ </div>
78
+ <div>
79
+ <h3>.emphasis-double-circle</h3>
80
+ <p><span class="emphasis-bottom emphasis-double-circle">Double circle emphasis marks</span></p>
81
+ </div>
82
+ <div>
83
+ <h3>.emphasis-triangle</h3>
84
+ <p><span class="emphasis-bottom emphasis-triangle">Triangle emphasis marks</span></p>
85
+ </div>
86
+ <div>
87
+ <h3>.emphasis-sesame</h3>
88
+ <p><span class="emphasis-bottom emphasis-sesame">Sesame dot emphasis marks</span></p>
89
+ </div>
90
+ </div>
91
+
92
+ <h2 id="hollow">Open (hollow) fill</h2>
93
+ <div class="section">
94
+ <div>
95
+ <h3>.emphasis-open + .emphasis-dot</h3>
96
+ <p><span class="emphasis-bottom emphasis-open emphasis-dot">Hollow dot marks</span></p>
97
+ </div>
98
+ <div>
99
+ <h3>.emphasis-open + .emphasis-double-circle</h3>
100
+ <p><span class="emphasis-bottom emphasis-open emphasis-double-circle">Hollow double circle marks</span></p>
101
+ </div>
102
+ <div>
103
+ <h3>.emphasis-open + .emphasis-triangle</h3>
104
+ <p><span class="emphasis-bottom emphasis-open emphasis-triangle">Hollow triangle marks</span></p>
105
+ </div>
106
+ <div>
107
+ <h3>.emphasis-open + .emphasis-sesame</h3>
108
+ <p><span class="emphasis-bottom emphasis-open emphasis-sesame">Hollow sesame marks</span></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
+ <h3>Theme color</h3>
123
+ <p><span class="emphasis-bottom emphasis-error">Error color emphasis</span></p>
124
+ </div>
125
+ <div>
126
+ <h3>Tailwind built-in</h3>
127
+ <p><span class="emphasis-top emphasis-green-500">Green-500 top emphasis</span></p>
128
+ <p><span class="emphasis-bottom emphasis-blue-600 emphasis-dot">Blue-600 dot emphasis</span></p>
129
+ <p><span class="emphasis-bottom emphasis-amber-500 emphasis-triangle">Amber-500 triangle emphasis</span></p>
130
+ </div>
131
+ <div>
132
+ <h3>Raw color</h3>
133
+ <p><span class="emphasis-bottom emphasis-[#ff0000] emphasis-triangle">Red (#ff0000) triangle emphasis</span></p>
134
+ </div>
135
+ </div>
136
+
137
+ <h2 id="comparison">Comparison with Western emphasis</h2>
138
+ <div class="section">
139
+ <p><strong>English (default):</strong> This is a <em>standard italic emphasis</em> in English. (Western languages
140
+ not matching East Asian code remain as default italic.)</p>
141
+ </div>
142
+
143
+ <script src="./demo-utils.js"></script>
144
+ </body>
145
+
146
+ </html>