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.
- package/CHANGELOG.md +74 -0
- package/LICENSE +49 -0
- package/README.md +386 -0
- package/README.zh-CN.md +385 -0
- package/dist/wispcss.css +45823 -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 +78 -0
- package/script-prefix.js +398 -0
- package/skill.md +575 -0
|
@@ -0,0 +1,251 @@
|
|
|
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>Rating - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Rating Component</h1>
|
|
14
|
+
<p>Star rating control using SVG mask on <code>input[type=radio]</code>. Supports connected mode (default), radio mode, half-star, custom icons, and dynamic colors.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li>Base: <code>.rating</code>. Default mode cascades — checking a star highlights all before it.</li>
|
|
20
|
+
<li>Use <code>.rating-radio</code> for independent selection (no cascading).</li>
|
|
21
|
+
<li>Wrap two <code>input[type=radio]</code> inside a <code><span></code> for half-star support.</li>
|
|
22
|
+
<li>Use <code><span data-role="item" data-checked="true"></code> for static display.</li>
|
|
23
|
+
<li>Sizes: <code>rating-4</code> ~ <code>rating-15</code> — default <code>rating-8</code> (32px).</li>
|
|
24
|
+
<li>Width: <code>rating-full</code>, <code>rating-scale</code>, <code>rating-scale-*</code>, <code>rating-ratio-*</code>, <code>rating-gutter</code>, <code>rating-gutter-*</code>.</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<h2 id="basic">Basic usage</h2>
|
|
29
|
+
<div class="section">
|
|
30
|
+
<div>
|
|
31
|
+
<h3>Connected mode (default)</h3>
|
|
32
|
+
<div class="rating">
|
|
33
|
+
<input type="radio" name="r1" value="1">
|
|
34
|
+
<input type="radio" name="r1" value="2">
|
|
35
|
+
<input type="radio" name="r1" value="3" checked>
|
|
36
|
+
<input type="radio" name="r1" value="4">
|
|
37
|
+
<input type="radio" name="r1" value="5">
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div>
|
|
41
|
+
<h3>Radio mode (rating-radio)</h3>
|
|
42
|
+
<div class="rating rating-radio">
|
|
43
|
+
<label><input type="radio" name="r2" value="1"></label>
|
|
44
|
+
<label><input type="radio" name="r2" value="2"></label>
|
|
45
|
+
<label><input type="radio" name="r2" value="3"></label>
|
|
46
|
+
<label><input type="radio" name="r2" value="4"></label>
|
|
47
|
+
<label><input type="radio" name="r2" value="5" checked></label>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div>
|
|
51
|
+
<h3>Static display (data-role=item)</h3>
|
|
52
|
+
<div class="rating">
|
|
53
|
+
<span data-role="item"></span>
|
|
54
|
+
<span data-role="item"></span>
|
|
55
|
+
<span data-role="item"></span>
|
|
56
|
+
<span data-role="item" data-checked="true"></span>
|
|
57
|
+
<span data-role="item"></span>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div>
|
|
61
|
+
<h3>With labels</h3>
|
|
62
|
+
<div class="rating rating-gutter-4">
|
|
63
|
+
<label><input type="radio" name="r3" value="1">Bad</label>
|
|
64
|
+
<label><input type="radio" name="r3" value="2">Okay</label>
|
|
65
|
+
<label><input type="radio" name="r3" value="3">Good</label>
|
|
66
|
+
<label><input type="radio" name="r3" value="4">Great</label>
|
|
67
|
+
<label><input type="radio" name="r3" value="5" checked>Excellent</label>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<h2 id="sizes">Sizes (rating-4 ~ rating-15)</h2>
|
|
73
|
+
<div class="section">
|
|
74
|
+
<div>
|
|
75
|
+
<h3>16px (rating-4)</h3>
|
|
76
|
+
<div class="rating rating-4"><input type="radio" name="s4" value="1"><input type="radio" name="s4" value="2" checked><input type="radio" name="s4" value="3"><input type="radio" name="s4" value="4"><input type="radio" name="s4" value="5"></div>
|
|
77
|
+
</div>
|
|
78
|
+
<div>
|
|
79
|
+
<h3>20px (rating-5)</h3>
|
|
80
|
+
<div class="rating rating-5"><input type="radio" name="s5" value="1"><input type="radio" name="s5" value="2" checked><input type="radio" name="s5" value="3"><input type="radio" name="s5" value="4"><input type="radio" name="s5" value="5"></div>
|
|
81
|
+
</div>
|
|
82
|
+
<div>
|
|
83
|
+
<h3>24px (rating-6)</h3>
|
|
84
|
+
<div class="rating rating-6"><input type="radio" name="s6" value="1"><input type="radio" name="s6" value="2" checked><input type="radio" name="s6" value="3"><input type="radio" name="s6" value="4"><input type="radio" name="s6" value="5"></div>
|
|
85
|
+
</div>
|
|
86
|
+
<div>
|
|
87
|
+
<h3>28px (rating-7)</h3>
|
|
88
|
+
<div class="rating rating-7"><input type="radio" name="s7" value="1"><input type="radio" name="s7" value="2" checked><input type="radio" name="s7" value="3"><input type="radio" name="s7" value="4"><input type="radio" name="s7" value="5"></div>
|
|
89
|
+
</div>
|
|
90
|
+
<div>
|
|
91
|
+
<h3>32px (rating-8, default)</h3>
|
|
92
|
+
<div class="rating rating-8"><input type="radio" name="s8" value="1"><input type="radio" name="s8" value="2" checked><input type="radio" name="s8" value="3"><input type="radio" name="s8" value="4"><input type="radio" name="s8" value="5"></div>
|
|
93
|
+
</div>
|
|
94
|
+
<div>
|
|
95
|
+
<h3>36px (rating-9)</h3>
|
|
96
|
+
<div class="rating rating-9"><input type="radio" name="s9" value="1"><input type="radio" name="s9" value="2" checked><input type="radio" name="s9" value="3"><input type="radio" name="s9" value="4"><input type="radio" name="s9" value="5"></div>
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<h3>40px (rating-10)</h3>
|
|
100
|
+
<div class="rating rating-10"><input type="radio" name="s10" value="1"><input type="radio" name="s10" value="2" checked><input type="radio" name="s10" value="3"><input type="radio" name="s10" value="4"><input type="radio" name="s10" value="5"></div>
|
|
101
|
+
</div>
|
|
102
|
+
<div>
|
|
103
|
+
<h3>44px (rating-11)</h3>
|
|
104
|
+
<div class="rating rating-11"><input type="radio" name="s11" value="1"><input type="radio" name="s11" value="2" checked><input type="radio" name="s11" value="3"><input type="radio" name="s11" value="4"><input type="radio" name="s11" value="5"></div>
|
|
105
|
+
</div>
|
|
106
|
+
<div>
|
|
107
|
+
<h3>48px (rating-12)</h3>
|
|
108
|
+
<div class="rating rating-12"><input type="radio" name="s12" value="1"><input type="radio" name="s12" value="2" checked><input type="radio" name="s12" value="3"><input type="radio" name="s12" value="4"><input type="radio" name="s12" value="5"></div>
|
|
109
|
+
</div>
|
|
110
|
+
<div>
|
|
111
|
+
<h3>52px (rating-13)</h3>
|
|
112
|
+
<div class="rating rating-13"><input type="radio" name="s13" value="1"><input type="radio" name="s13" value="2" checked><input type="radio" name="s13" value="3"><input type="radio" name="s13" value="4"><input type="radio" name="s13" value="5"></div>
|
|
113
|
+
</div>
|
|
114
|
+
<div>
|
|
115
|
+
<h3>56px (rating-14)</h3>
|
|
116
|
+
<div class="rating rating-14"><input type="radio" name="s14" value="1"><input type="radio" name="s14" value="2" checked><input type="radio" name="s14" value="3"><input type="radio" name="s14" value="4"><input type="radio" name="s14" value="5"></div>
|
|
117
|
+
</div>
|
|
118
|
+
<div>
|
|
119
|
+
<h3>60px (rating-15)</h3>
|
|
120
|
+
<div class="rating rating-15"><input type="radio" name="s15" value="1"><input type="radio" name="s15" value="2" checked><input type="radio" name="s15" value="3"><input type="radio" name="s15" value="4"><input type="radio" name="s15" value="5"></div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<h2 id="width-modifiers">Width modifiers</h2>
|
|
125
|
+
<div class="section">
|
|
126
|
+
<div>
|
|
127
|
+
<h3>rating-full (fill container)</h3>
|
|
128
|
+
<div class="rating rating-full">
|
|
129
|
+
<div><input type="radio" name="wf" value="1">Bad</div>
|
|
130
|
+
<div><input type="radio" name="wf" value="2">Okay</div>
|
|
131
|
+
<div><input type="radio" name="wf" value="3" checked>Good</div>
|
|
132
|
+
<div><input type="radio" name="wf" value="4">Great</div>
|
|
133
|
+
<div><input type="radio" name="wf" value="5">Excellent</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
<div>
|
|
137
|
+
<h3>rating-scale (fixed width)</h3>
|
|
138
|
+
<div class="rating rating-scale rating-warning">
|
|
139
|
+
<div><input type="radio" name="ws" value="1">Bad</div>
|
|
140
|
+
<div><input type="radio" name="ws" value="2">Okay</div>
|
|
141
|
+
<div><input type="radio" name="ws" value="3" checked>Good</div>
|
|
142
|
+
<div><input type="radio" name="ws" value="4">Great</div>
|
|
143
|
+
<div><input type="radio" name="ws" value="5">Excellent</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<div>
|
|
147
|
+
<h3>rating-ratio-8 (8x height)</h3>
|
|
148
|
+
<div class="rating rating-ratio-8">
|
|
149
|
+
<div><input type="radio" name="wr" value="1">Bad</div>
|
|
150
|
+
<div><input type="radio" name="wr" value="2">Okay</div>
|
|
151
|
+
<div><input type="radio" name="wr" value="3" checked>Good</div>
|
|
152
|
+
<div><input type="radio" name="wr" value="4">Great</div>
|
|
153
|
+
<div><input type="radio" name="wr" value="5">Excellent</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
<div>
|
|
157
|
+
<h3>rating-gutter / rating-gutter-6</h3>
|
|
158
|
+
<div class="rating rating-gutter"><input type="radio" name="wg" value="1"><input type="radio" name="wg" value="2"><input type="radio" name="wg" value="3" checked><input type="radio" name="wg" value="4"><input type="radio" name="wg" value="5"></div>
|
|
159
|
+
<div class="rating rating-gutter-6"><input type="radio" name="wg2" value="1"><input type="radio" name="wg2" value="2"><input type="radio" name="wg2" value="3" checked><input type="radio" name="wg2" value="4"><input type="radio" name="wg2" value="5"></div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<h2 id="theme-colors">Theme colors</h2>
|
|
164
|
+
<div class="section">
|
|
165
|
+
<div>
|
|
166
|
+
<h3>Primary / Secondary / Tertiary</h3>
|
|
167
|
+
<div class="rating rating-primary"><input type="radio" name="c1" value="1"><input type="radio" name="c1" value="2"><input type="radio" name="c1" value="3" checked><input type="radio" name="c1" value="4"><input type="radio" name="c1" value="5"></div>
|
|
168
|
+
<div class="rating rating-secondary"><input type="radio" name="c2" value="1"><input type="radio" name="c2" value="2"><input type="radio" name="c2" value="3" checked><input type="radio" name="c2" value="4"><input type="radio" name="c2" value="5"></div>
|
|
169
|
+
<div class="rating rating-tertiary"><input type="radio" name="c3" value="1"><input type="radio" name="c3" value="2"><input type="radio" name="c3" value="3" checked><input type="radio" name="c3" value="4"><input type="radio" name="c3" value="5"></div>
|
|
170
|
+
</div>
|
|
171
|
+
<div>
|
|
172
|
+
<h3>Success / Error / Info</h3>
|
|
173
|
+
<div class="rating rating-success"><input type="radio" name="c4" value="1"><input type="radio" name="c4" value="2"><input type="radio" name="c4" value="3" checked><input type="radio" name="c4" value="4"><input type="radio" name="c4" value="5"></div>
|
|
174
|
+
<div class="rating rating-error"><input type="radio" name="c5" value="1"><input type="radio" name="c5" value="2"><input type="radio" name="c5" value="3" checked><input type="radio" name="c5" value="4"><input type="radio" name="c5" value="5"></div>
|
|
175
|
+
<div class="rating rating-info"><input type="radio" name="c6" value="1"><input type="radio" name="c6" value="2"><input type="radio" name="c6" value="3" checked><input type="radio" name="c6" value="4"><input type="radio" name="c6" value="5"></div>
|
|
176
|
+
</div>
|
|
177
|
+
<div>
|
|
178
|
+
<h3>Highlight / Warning / Caution</h3>
|
|
179
|
+
<div class="rating rating-highlight"><input type="radio" name="c7" value="1"><input type="radio" name="c7" value="2"><input type="radio" name="c7" value="3" checked><input type="radio" name="c7" value="4"><input type="radio" name="c7" value="5"></div>
|
|
180
|
+
<div class="rating rating-warning"><input type="radio" name="c8" value="1"><input type="radio" name="c8" value="2"><input type="radio" name="c8" value="3" checked><input type="radio" name="c8" value="4"><input type="radio" name="c8" value="5"></div>
|
|
181
|
+
<div class="rating rating-caution"><input type="radio" name="c9" value="1"><input type="radio" name="c9" value="2"><input type="radio" name="c9" value="3" checked><input type="radio" name="c9" value="4"><input type="radio" name="c9" value="5"></div>
|
|
182
|
+
</div>
|
|
183
|
+
<div>
|
|
184
|
+
<h3>Ink / Title / Description / Caption / Disabled</h3>
|
|
185
|
+
<div class="rating rating-ink"><input type="radio" name="c10" value="1"><input type="radio" name="c10" value="2"><input type="radio" name="c10" value="3" checked><input type="radio" name="c10" value="4"><input type="radio" name="c10" value="5"></div>
|
|
186
|
+
<div class="rating rating-title"><input type="radio" name="c11" value="1"><input type="radio" name="c11" value="2"><input type="radio" name="c11" value="3" checked><input type="radio" name="c11" value="4"><input type="radio" name="c11" value="5"></div>
|
|
187
|
+
<div class="rating rating-description"><input type="radio" name="c12" value="1"><input type="radio" name="c12" value="2"><input type="radio" name="c12" value="3" checked><input type="radio" name="c12" value="4"><input type="radio" name="c12" value="5"></div>
|
|
188
|
+
<div class="rating rating-caption"><input type="radio" name="c13" value="1"><input type="radio" name="c13" value="2"><input type="radio" name="c13" value="3" checked><input type="radio" name="c13" value="4"><input type="radio" name="c13" value="5"></div>
|
|
189
|
+
<div class="rating rating-placeholder"><input type="radio" name="c14" value="1"><input type="radio" name="c14" value="2"><input type="radio" name="c14" value="3" checked><input type="radio" name="c14" value="4"><input type="radio" name="c14" value="5"></div>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<h2 id="custom-colors">Custom colors</h2>
|
|
194
|
+
<p>Multiple color formats are supported:</p>
|
|
195
|
+
<ul>
|
|
196
|
+
<li>1. Theme semantic colors, e.g. <code>*-error</code>, <code>*-error-hover</code></li>
|
|
197
|
+
<li>2. Tailwind built-in colors, e.g. <code>*-indigo-500</code></li>
|
|
198
|
+
<li>3. Raw color values, e.g. <code>*-[#ff0000]</code></li>
|
|
199
|
+
<li>4. CSS named colors, e.g. <code>*-[red]</code>, <code>*-[green]</code></li>
|
|
200
|
+
</ul>
|
|
201
|
+
<div class="section">
|
|
202
|
+
<div>
|
|
203
|
+
<h3>Tailwind + raw colors</h3>
|
|
204
|
+
<div class="rating rating-indigo-500"><input type="radio" name="x1" value="1"><input type="radio" name="x1" value="2"><input type="radio" name="x1" value="3" checked><input type="radio" name="x1" value="4"><input type="radio" name="x1" value="5"></div>
|
|
205
|
+
<div class="rating rating-[#ff6600]"><input type="radio" name="x2" value="1"><input type="radio" name="x2" value="2"><input type="radio" name="x2" value="3" checked><input type="radio" name="x2" value="4"><input type="radio" name="x2" value="5"></div>
|
|
206
|
+
</div>
|
|
207
|
+
<div>
|
|
208
|
+
<h3>Per-item custom color (--custom-item-color)</h3>
|
|
209
|
+
<div class="rating rating-gutter-4">
|
|
210
|
+
<label><input type="radio" name="x3" value="1" class="[--custom-item-color:var(--color-green-200)]">Bad</label>
|
|
211
|
+
<label><input type="radio" name="x3" value="2" class="[--custom-item-color:var(--color-blue-200)]">Okay</label>
|
|
212
|
+
<label><input type="radio" name="x3" value="3" class="[--custom-item-color:var(--color-red-200)]">Good</label>
|
|
213
|
+
<label><input type="radio" name="x3" value="4" class="[--custom-item-color:var(--color-indigo-200)]">Great</label>
|
|
214
|
+
<label><input type="radio" name="x3" value="5" class="[--custom-item-color:var(--color-orange-200)]">Excellent</label>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<h2 id="half-star-mode">Half-star mode</h2>
|
|
220
|
+
<div class="section">
|
|
221
|
+
<div>
|
|
222
|
+
<p>Wrap two <code>input[type=radio]</code> inside a <code><span></code> for half-star precision.</p>
|
|
223
|
+
<div class="rating rating-warning">
|
|
224
|
+
<span><input type="radio" name="h1" value="0.5"><input type="radio" name="h1" value="1"></span>
|
|
225
|
+
<span><input type="radio" name="h1" value="1.5" checked><input type="radio" name="h1" value="2"></span>
|
|
226
|
+
<span><input type="radio" name="h1" value="2.5"><input type="radio" name="h1" value="3"></span>
|
|
227
|
+
<span><input type="radio" name="h1" value="3.5"><input type="radio" name="h1" value="4"></span>
|
|
228
|
+
<span><input type="radio" name="h1" value="4.5"><input type="radio" name="h1" value="5"></span>
|
|
229
|
+
<span>Score: 1.5</span>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<h2 id="custom-icon-rating-mask-image">Custom icon (--rating-mask-image)</h2>
|
|
235
|
+
<div class="section">
|
|
236
|
+
<div>
|
|
237
|
+
<p>Replace the star with a custom SVG mask via <code>--rating-mask-image</code>.</p>
|
|
238
|
+
<div class="rating" style="--rating-mask-image:url('data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22black%22 d=%22M6.979 3.074a6 6 0 0 1 4.988 1.425l.037 .033l.034 -.03a6 6 0 0 1 4.733 -1.44l.246 .036a6 6 0 0 1 3.364 10.008l-.18 .185l-.048 .041l-7.45 7.379a1 1 0 0 1 -1.313 .082l-.094 -.082l-7.493 -7.422a6 6 0 0 1 3.176 -10.215z%22/%3E%3C/svg%3E');">
|
|
239
|
+
<div><input type="radio" name="ci1" value="1">Bad</div>
|
|
240
|
+
<div><input type="radio" name="ci1" value="2">Okay</div>
|
|
241
|
+
<div><input type="radio" name="ci1" value="3" checked>Good</div>
|
|
242
|
+
<div><input type="radio" name="ci1" value="4">Great</div>
|
|
243
|
+
<div><input type="radio" name="ci1" value="5">Excellent</div>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<script src="./demo-utils.js"></script>
|
|
249
|
+
</body>
|
|
250
|
+
|
|
251
|
+
</html>
|
|
@@ -0,0 +1,105 @@
|
|
|
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>Reset - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Reset Utilities</h1>
|
|
14
|
+
<p>The <code>.reset-*</code> classes restore native browser appearance for elements that custom styles are applied to. Compare default WispCSS styles (left) with reset styles (right) below.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li><code>.reset-ul</code> — removes custom bullet dots and indentation from <code><ul></code>, restores browser default list style.</li>
|
|
20
|
+
<li><code>.reset-ol</code> — same as <code>.reset-ul</code> but for <code><ol></code> (ordered lists).</li>
|
|
21
|
+
<li><code>.reset-dl</code> — removes top/bottom borders, decorative dots, bold title style from <code><dl></code>, returns plain text definition list.</li>
|
|
22
|
+
<li><code>.reset-heading</code> — removes margins from <code><h1></code> ~ <code><h6></code>.</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<h2 id="ul-ol-list-reset">ul / ol list reset</h2>
|
|
27
|
+
<div class="section">
|
|
28
|
+
<div style="display: flex; gap: 24px; flex-wrap: wrap;">
|
|
29
|
+
<div style="flex: 1; min-width: 280px; padding: 12px; border: 1px dashed #ddd; border-radius: 6px;">
|
|
30
|
+
<h3>Default (WispCSS style)</h3>
|
|
31
|
+
<ul>
|
|
32
|
+
<li>Item A<ul><li>Nested A<ul><li>Deep nested</li></ul></li></ul></li>
|
|
33
|
+
<li>Item B</li>
|
|
34
|
+
<li>Item C</li>
|
|
35
|
+
</ul>
|
|
36
|
+
<ol>
|
|
37
|
+
<li>First step<ol><li>Sub step</li></ol></li>
|
|
38
|
+
<li>Second step</li>
|
|
39
|
+
</ol>
|
|
40
|
+
</div>
|
|
41
|
+
<div style="flex: 1; min-width: 280px; padding: 12px; border: 1px dashed #ddd; border-radius: 6px;">
|
|
42
|
+
<h3>.reset-ul / .reset-ol</h3>
|
|
43
|
+
<ul class="reset-ul">
|
|
44
|
+
<li>Item A<ul class="reset-ul"><li>Nested A<ul class="reset-ul"><li>Deep nested</li></ul></li></ul></li>
|
|
45
|
+
<li>Item B</li>
|
|
46
|
+
<li>Item C</li>
|
|
47
|
+
</ul>
|
|
48
|
+
<ol class="reset-ol">
|
|
49
|
+
<li>First step<ol class="reset-ol"><li>Sub step</li></ol></li>
|
|
50
|
+
<li>Second step</li>
|
|
51
|
+
</ol>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<h2 id="dl-reset">dl reset</h2>
|
|
57
|
+
<div class="section">
|
|
58
|
+
<div style="display: flex; gap: 24px; flex-wrap: wrap;">
|
|
59
|
+
<div style="flex: 1; min-width: 280px; padding: 12px; border: 1px dashed #ddd; border-radius: 6px;">
|
|
60
|
+
<h3>Default (WispCSS style)</h3>
|
|
61
|
+
<dl>
|
|
62
|
+
<dt>Beijing</dt><dd>21.8M</dd>
|
|
63
|
+
<dt>Shanghai</dt><dd>24.7M</dd>
|
|
64
|
+
<dt>Guangzhou</dt><dd>18.7M</dd>
|
|
65
|
+
</dl>
|
|
66
|
+
</div>
|
|
67
|
+
<div style="flex: 1; min-width: 280px; padding: 12px; border: 1px dashed #ddd; border-radius: 6px;">
|
|
68
|
+
<h3>.reset-dl</h3>
|
|
69
|
+
<dl class="reset-dl">
|
|
70
|
+
<dt>Beijing</dt><dd>21.8M</dd>
|
|
71
|
+
<dt>Shanghai</dt><dd>24.7M</dd>
|
|
72
|
+
<dt>Guangzhou</dt><dd>18.7M</dd>
|
|
73
|
+
</dl>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<h2 id="heading-reset">Heading reset</h2>
|
|
79
|
+
<div class="section">
|
|
80
|
+
<div style="display: flex; gap: 24px; flex-wrap: wrap;">
|
|
81
|
+
<div style="flex: 1; min-width: 280px; padding: 12px; border: 1px dashed #ddd; border-radius: 6px;">
|
|
82
|
+
<h3>Default (WispCSS style)</h3>
|
|
83
|
+
<h1>h1 Heading</h1>
|
|
84
|
+
<h2 id="h2-heading">h2 Heading</h2>
|
|
85
|
+
<h3>h3 Heading</h3>
|
|
86
|
+
<h4>h4 Heading</h4>
|
|
87
|
+
<h5>h5 Heading</h5>
|
|
88
|
+
<h6>h6 Heading</h6>
|
|
89
|
+
</div>
|
|
90
|
+
<div style="flex: 1; min-width: 280px; padding: 12px; border: 1px dashed #ddd; border-radius: 6px;">
|
|
91
|
+
<h3>.reset-heading</h3>
|
|
92
|
+
<h1 class="reset-heading">h1 Heading (no margin)</h1>
|
|
93
|
+
<h2 class="reset-heading">h2 Heading (no margin)</h2>
|
|
94
|
+
<h3 class="reset-heading">h3 Heading (no margin)</h3>
|
|
95
|
+
<h4 class="reset-heading">h4 Heading (no margin)</h4>
|
|
96
|
+
<h5 class="reset-heading">h5 Heading (no margin)</h5>
|
|
97
|
+
<h6 class="reset-heading">h6 Heading (no margin)</h6>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<script src="./demo-utils.js"></script>
|
|
103
|
+
</body>
|
|
104
|
+
|
|
105
|
+
</html>
|