wispcss 0.0.0-stage → 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 +385 -2
- 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 +73 -3
- 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,149 @@
|
|
|
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>Size - WispCSS Demo</title>
|
|
10
|
+
<style>
|
|
11
|
+
.box {
|
|
12
|
+
background: var(--color-primary);
|
|
13
|
+
color: var(--color-primary-contrast);
|
|
14
|
+
border-radius: var(--default-border-radius);
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
}
|
|
21
|
+
.outline-box {
|
|
22
|
+
height:200px;
|
|
23
|
+
border: 1px solid var(--color-title-bd);
|
|
24
|
+
border-radius: var(--default-border-radius);
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
27
|
+
</head>
|
|
28
|
+
|
|
29
|
+
<body>
|
|
30
|
+
<h1>Size Component</h1>
|
|
31
|
+
<p>Overflow-safe dynamic sizes, input-proportional sizes, and floating overlay sizes — supplementing Tailwind's width / height utilities.</p>
|
|
32
|
+
|
|
33
|
+
<h2 id="safe">Overflow-safe sizes</h2>
|
|
34
|
+
<p>Dynamic width / height capped at <code>100%</code> so the element never overflows its parent.</p>
|
|
35
|
+
<div class="section">
|
|
36
|
+
<div>
|
|
37
|
+
<h3>w-safe-* — dynamic width</h3>
|
|
38
|
+
<p>Fixed <code>w-safe-96</code>:</p>
|
|
39
|
+
<div class="box w-safe-96">w-safe-96</div>
|
|
40
|
+
<p>Fixed-in-length <code>w-safe-[40rem]</code>:</p>
|
|
41
|
+
<div class="box w-safe-[40rem]">w-safe-[40rem]</div>
|
|
42
|
+
<p>Narrow parent — capped at 100%:</p>
|
|
43
|
+
<div style="max-width:160px;"><div class="box w-safe-96" style="height:2rem;">capped</div></div>
|
|
44
|
+
</div>
|
|
45
|
+
<div>
|
|
46
|
+
<h3>h-safe-* — dynamic height</h3>
|
|
47
|
+
<div>
|
|
48
|
+
<p><code>h-safe-48</code>:</p>
|
|
49
|
+
<div class="box h-safe-48">h-safe-48</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<p><code>h-safe-[4rem]</code>:</p>
|
|
53
|
+
<div class="box h-safe-[4rem]">4rem</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div>
|
|
57
|
+
<h3>size-safe-* — dynamic width + height</h3>
|
|
58
|
+
<div>
|
|
59
|
+
<p><code>size-safe-24</code>:</p>
|
|
60
|
+
<div class="box size-safe-24">24</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div>
|
|
63
|
+
<p><code>size-safe-[20rem]</code>:</p>
|
|
64
|
+
<div class="box size-safe-[20rem]" style="height:6rem;">20rem</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<h2 id="input">Input-based sizes</h2>
|
|
70
|
+
<p>Dimensions derived from the default input metrics (<code>--default-width-input</code> / <code>--default-height-input</code>), capped at 100%.</p>
|
|
71
|
+
<div class="section">
|
|
72
|
+
<div>
|
|
73
|
+
<h3>w-input / w-input-* — width</h3>
|
|
74
|
+
<p><code>w-input</code> (default input width):</p>
|
|
75
|
+
<div class="box w-input" style="height:2rem;">w-input</div>
|
|
76
|
+
<p><code>w-input-2</code> (2x):</p>
|
|
77
|
+
<div class="box w-input-2" style="height:2rem;">w-input-2</div>
|
|
78
|
+
<p><code>w-input-3</code> (3x):</p>
|
|
79
|
+
<div class="box w-input-3" style="height:2rem;">w-input-3</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<h3>h-input / h-input-* — height</h3>
|
|
83
|
+
<div>
|
|
84
|
+
<p><code>h-input</code>:</p>
|
|
85
|
+
<div class="box h-input">h-input</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div>
|
|
88
|
+
<p><code>h-input-2</code>:</p>
|
|
89
|
+
<div class="box h-input-2">h-input-2</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<h2 id="overlay">Overlay sizes</h2>
|
|
95
|
+
<p>Floating layer dimensions relative to the parent, keeping safe gaps.</p>
|
|
96
|
+
<div class="section">
|
|
97
|
+
<div>
|
|
98
|
+
<h3>w-overlay — full-width layer</h3>
|
|
99
|
+
<div class="outline-box flex-center">
|
|
100
|
+
<div class="box w-overlay" >w-overlay</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
<div>
|
|
104
|
+
<h3>h-overlay — full-height layer</h3>
|
|
105
|
+
<div class="outline-box flex-center">
|
|
106
|
+
<div class="box h-overlay" style="width:8rem;">h-overlay</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div>
|
|
110
|
+
<h3>size-overlay — full-width + full-height layer</h3>
|
|
111
|
+
<div class="outline-box flex-center">
|
|
112
|
+
<div class="box size-overlay">size-overlay</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<h2 id="interactive">Interactive size switching</h2>
|
|
118
|
+
<p>Click a button to apply a size class to the child box. The current computed size is displayed below. In a narrow parent, any overflow is capped at <code>100%</code>.</p>
|
|
119
|
+
<div class="section">
|
|
120
|
+
<div class="outline-box flex-center">
|
|
121
|
+
<div id="interactive-box" class="box">child</div>
|
|
122
|
+
</div>
|
|
123
|
+
<button class="btn btn-primary" onclick="setBoxClass('w-safe-48');">w-safe-48</button>
|
|
124
|
+
<button class="btn btn-primary" onclick="setBoxClass('w-safe-96');">w-safe-96</button>
|
|
125
|
+
<button class="btn btn-primary" onclick="setBoxClass('w-safe-1000');">w-safe-1000</button>
|
|
126
|
+
<button class="btn btn-primary" onclick="setBoxClass('w-safe-[20rem]');">w-safe-[20rem]</button>
|
|
127
|
+
<button class="btn btn-primary" onclick="setBoxClass('w-input');">w-input</button>
|
|
128
|
+
<button class="btn btn-primary" onclick="setBoxClass('w-input-2');">w-input-2</button>
|
|
129
|
+
<button class="btn btn-primary" onclick="setBoxClass('w-overlay');">w-overlay</button>
|
|
130
|
+
<button class="btn btn-primary" onclick="setBoxClass('h-safe-10');">h-safe-10</button>
|
|
131
|
+
<button class="btn btn-primary" onclick="setBoxClass('h-safe-100');">h-safe-100</button>
|
|
132
|
+
<button class="btn btn-primary" onclick="setBoxClass('h-overlay');">h-overlay</button>
|
|
133
|
+
<button class="btn btn-primary" onclick="setBoxClass('size-safe-14');">size-safe-14</button>
|
|
134
|
+
<button class="btn btn-primary" onclick="setBoxClass('size-safe-100');">size-safe-100</button>
|
|
135
|
+
<button class="btn btn-primary" onclick="setBoxClass('size-overlay');">size-overlay</button>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<script>
|
|
139
|
+
const interactiveBox = document.getElementById('interactive-box');
|
|
140
|
+
const interactiveSize = document.getElementById('interactive-size');
|
|
141
|
+
function setBoxClass(cls) {
|
|
142
|
+
interactiveBox.className = 'box ' + cls;
|
|
143
|
+
const rect = interactiveBox.getBoundingClientRect();
|
|
144
|
+
}
|
|
145
|
+
</script>
|
|
146
|
+
<script src="./demo-utils.js"></script>
|
|
147
|
+
</body>
|
|
148
|
+
|
|
149
|
+
</html>
|
|
@@ -0,0 +1,143 @@
|
|
|
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>Skeleton - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Skeleton Component</h1>
|
|
14
|
+
<p>Loading placeholder that renders a shimmer sweep or pulse animation. Add <code>.skeleton</code> to any element and set its dimensions via <code>width</code> / <code>height</code> / <code>border-radius</code>. All child content is automatically hidden.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li>Base: <code>.skeleton</code>. Requires explicit <code>width</code>, <code>height</code>, and optionally <code>border-radius</code>.</li>
|
|
20
|
+
<li>Uses a <code>::after</code> pseudo-element with a diagonal shimmer gradient overlay.</li>
|
|
21
|
+
<li>Add <code>.skeleton-pulse</code> to switch from shimmer to a simple opacity breathing animation.</li>
|
|
22
|
+
<li>Set a background color via Tailwind utilities (e.g. <code>bg-title-bd</code>) or inline styles for the base skeleton color.</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<h2 id="shimmer-default">Shimmer (default)</h2>
|
|
27
|
+
<div class="section">
|
|
28
|
+
<div>
|
|
29
|
+
<h3>Text lines</h3>
|
|
30
|
+
<div class="skeleton" style="width: 200px; height: 16px; border-radius: 4px;"></div>
|
|
31
|
+
<div class="skeleton" style="width: 140px; height: 16px; border-radius: 4px; margin-top: 8px;"></div>
|
|
32
|
+
<div class="skeleton" style="width: 280px; height: 16px; border-radius: 4px; margin-top: 8px;"></div>
|
|
33
|
+
</div>
|
|
34
|
+
<div>
|
|
35
|
+
<h3>Circle avatars</h3>
|
|
36
|
+
<div class="skeleton" style="width: 48px; height: 48px; border-radius: 50%; display: inline-block;"></div>
|
|
37
|
+
<div class="skeleton" style="width: 40px; height: 40px; border-radius: 50%; display: inline-block;"></div>
|
|
38
|
+
<div class="skeleton" style="width: 32px; height: 32px; border-radius: 50%; display: inline-block;"></div>
|
|
39
|
+
</div>
|
|
40
|
+
<div>
|
|
41
|
+
<h3>Square thumbnails</h3>
|
|
42
|
+
<div class="skeleton" style="width: 80px; height: 80px; border-radius: 8px; display: inline-block;"></div>
|
|
43
|
+
<div class="skeleton" style="width: 64px; height: 64px; border-radius: 8px; display: inline-block;"></div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<h2 id="pulse-skeleton-pulse">Pulse (skeleton-pulse)</h2>
|
|
48
|
+
<div class="section">
|
|
49
|
+
<div>
|
|
50
|
+
<h3>Text lines</h3>
|
|
51
|
+
<div class="skeleton skeleton-pulse " style="width: 200px; height: 16px; border-radius: 4px;"></div>
|
|
52
|
+
<div class="skeleton skeleton-pulse " style="width: 140px; height: 16px; border-radius: 4px; margin-top: 8px;"></div>
|
|
53
|
+
</div>
|
|
54
|
+
<div>
|
|
55
|
+
<h3>Circle + square</h3>
|
|
56
|
+
<div class="skeleton skeleton-pulse " style="width: 48px; height: 48px; border-radius: 50%; display: inline-block;"></div>
|
|
57
|
+
<div class="skeleton skeleton-pulse " style="width: 80px; height: 80px; border-radius: 8px; display: inline-block;"></div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<h2 id="use-cases">Use cases</h2>
|
|
62
|
+
<div class="section">
|
|
63
|
+
<div>
|
|
64
|
+
<h3>Article card</h3>
|
|
65
|
+
<div style="display: flex; flex-direction: column; gap: 12px; max-width: 300px;">
|
|
66
|
+
<div class="skeleton" style="width: 100%; height: 140px; border-radius: 8px;"></div>
|
|
67
|
+
<div class="skeleton" style="width: 80%; height: 18px; border-radius: 4px;"></div>
|
|
68
|
+
<div class="skeleton" style="width: 60%; height: 14px; border-radius: 4px;"></div>
|
|
69
|
+
<div style="display: flex; gap: 8px; align-items: center;">
|
|
70
|
+
<div class="skeleton" style="width: 24px; height: 24px; border-radius: 50%;"></div>
|
|
71
|
+
<div class="skeleton" style="width: 100px; height: 12px; border-radius: 4px;"></div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div>
|
|
76
|
+
<h3>List items</h3>
|
|
77
|
+
<div style="display: flex; flex-direction: column; gap: 12px; max-width: 300px;">
|
|
78
|
+
<div style="display: flex; gap: 12px; align-items: center;">
|
|
79
|
+
<div class="skeleton" style="width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;"></div>
|
|
80
|
+
<div style="flex: 1; display: flex; flex-direction: column; gap: 6px;">
|
|
81
|
+
<div class="skeleton" style="width: 60%; height: 14px; border-radius: 4px;"></div>
|
|
82
|
+
<div class="skeleton" style="width: 40%; height: 12px; border-radius: 4px;"></div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<div style="display: flex; gap: 12px; align-items: center;">
|
|
86
|
+
<div class="skeleton" style="width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;"></div>
|
|
87
|
+
<div style="flex: 1; display: flex; flex-direction: column; gap: 6px;">
|
|
88
|
+
<div class="skeleton" style="width: 60%; height: 14px; border-radius: 4px;"></div>
|
|
89
|
+
<div class="skeleton" style="width: 40%; height: 12px; border-radius: 4px;"></div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<div>
|
|
95
|
+
<h3>Form skeleton</h3>
|
|
96
|
+
<div style="display: flex; flex-direction: column; gap: 12px; max-width: 300px;">
|
|
97
|
+
<div class="skeleton" style="width: 60px; height: 12px; border-radius: 4px;"></div>
|
|
98
|
+
<div class="skeleton" style="width: 100%; height: 40px; border-radius: 8px;"></div>
|
|
99
|
+
<div class="skeleton" style="width: 60px; height: 12px; border-radius: 4px;"></div>
|
|
100
|
+
<div class="skeleton" style="width: 100%; height: 40px; border-radius: 8px;"></div>
|
|
101
|
+
<div class="skeleton" style="width: 100px; height: 40px; border-radius: 8px;"></div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<h3>Profile card</h3>
|
|
106
|
+
<div style="display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; max-width: 280px;">
|
|
107
|
+
<div class="skeleton" style="width: 72px; height: 72px; border-radius: 50%;"></div>
|
|
108
|
+
<div class="skeleton" style="width: 120px; height: 18px; border-radius: 4px;"></div>
|
|
109
|
+
<div class="skeleton" style="width: 180px; height: 14px; border-radius: 4px;"></div>
|
|
110
|
+
<div style="display: flex; gap: 12px;">
|
|
111
|
+
<div class="skeleton" style="width: 80px; height: 32px; border-radius: 6px;"></div>
|
|
112
|
+
<div class="skeleton" style="width: 80px; height: 32px; border-radius: 6px;"></div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
<div>
|
|
117
|
+
<h3>Article card (pulse)</h3>
|
|
118
|
+
<div style="display: flex; flex-direction: column; gap: 12px; max-width: 300px;">
|
|
119
|
+
<div class="skeleton skeleton-pulse " style="width: 100%; height: 140px; border-radius: 8px;"></div>
|
|
120
|
+
<div class="skeleton skeleton-pulse " style="width: 80%; height: 18px; border-radius: 4px;"></div>
|
|
121
|
+
<div class="skeleton skeleton-pulse " style="width: 60%; height: 14px; border-radius: 4px;"></div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<div>
|
|
125
|
+
<h3>List items (pulse)</h3>
|
|
126
|
+
<div style="display: flex; flex-direction: column; gap: 12px; max-width: 300px;">
|
|
127
|
+
<div style="display: flex; gap: 12px; align-items: center;">
|
|
128
|
+
<div class="skeleton skeleton-pulse " style="width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;"></div>
|
|
129
|
+
<div style="flex: 1; display: flex; flex-direction: column; gap: 6px;">
|
|
130
|
+
<div class="skeleton skeleton-pulse " style="width: 60%; height: 14px; border-radius: 4px;"></div>
|
|
131
|
+
<div class="skeleton skeleton-pulse " style="width: 40%; height: 12px; border-radius: 4px;"></div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<p style="margin-top: 2rem;">For regular loading indicators, see <a class="link" href="./demo-spinner.html">demo-spinner.html</a>.</p>
|
|
139
|
+
|
|
140
|
+
<script src="./demo-utils.js"></script>
|
|
141
|
+
</body>
|
|
142
|
+
|
|
143
|
+
|
|
@@ -0,0 +1,213 @@
|
|
|
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>Sketch - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Sketch Component</h1>
|
|
14
|
+
<p>Hand-drawn sketch style elements using irregular border-radius and SVG mask decorations. Includes frames, underlines, highlights, dividers, strikethrough, circling marks, and wrong/cross marks.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li>Frames: <code>sketch-frame</code> / <code>sketch-frame1</code> ~ <code>sketch-frame20</code>. Uses irregular border-radius. Combine with <code>border-*</code> classes for color.</li>
|
|
20
|
+
<li>Underline: <code>sketch-underline</code>. Thickness: <code>sketch-underline-1px</code>. Color: <code>sketch-underline-*</code> (e.g. <code>sketch-underline-primary</code>).</li>
|
|
21
|
+
<li>Highlight: <code>sketch-mark</code>. Color: <code>sketch-mark-*</code>.</li>
|
|
22
|
+
<li>Divider: <code>sketch-divider/sketch-divider-h</code> (horizontal), <code>sketch-divider-v</code> (vertical). Color: <code>sketch-divider-*</code>.</li>
|
|
23
|
+
<li>Strikethrough: <code>sketch-through</code>. Circle: <code>sketch-circling</code>. Cross: <code>sketch-wrong</code>. Each supports <code>sketch-wrong-1px</code> (thin) and <code>sketch-wrong-*</code> (color).</li>
|
|
24
|
+
</ul>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<h2 id="frames">Frames</h2>
|
|
28
|
+
<div class="section">
|
|
29
|
+
<div>
|
|
30
|
+
<h3>sketch-frame (default)</h3>
|
|
31
|
+
<div class="sketch-frame border-2 border-black p-4 text-sm">Default sketch frame</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<h3>Regular frames (sketch-frame1 ~ 10)</h3>
|
|
35
|
+
<div class="sketch-frame1 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">1</div>
|
|
36
|
+
<div class="sketch-frame2 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">2</div>
|
|
37
|
+
<div class="sketch-frame3 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">3</div>
|
|
38
|
+
<div class="sketch-frame4 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">4</div>
|
|
39
|
+
<div class="sketch-frame5 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">5</div>
|
|
40
|
+
<div class="sketch-frame6 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">6</div>
|
|
41
|
+
<div class="sketch-frame7 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">7</div>
|
|
42
|
+
<div class="sketch-frame8 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">8</div>
|
|
43
|
+
<div class="sketch-frame9 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">9</div>
|
|
44
|
+
<div class="sketch-frame10 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">10</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div>
|
|
47
|
+
<h3>Irregular frames (sketch-frame11 ~ 20)</h3>
|
|
48
|
+
<div class="sketch-frame11 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">11</div>
|
|
49
|
+
<div class="sketch-frame12 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">12</div>
|
|
50
|
+
<div class="sketch-frame13 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">13</div>
|
|
51
|
+
<div class="sketch-frame14 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">14</div>
|
|
52
|
+
<div class="sketch-frame15 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">15</div>
|
|
53
|
+
<div class="sketch-frame16 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">16</div>
|
|
54
|
+
<div class="sketch-frame17 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">17</div>
|
|
55
|
+
<div class="sketch-frame18 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">18</div>
|
|
56
|
+
<div class="sketch-frame19 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">19</div>
|
|
57
|
+
<div class="sketch-frame20 border-2 border-black p-4 text-sm" style="display:inline-block;margin:4px;">20</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div>
|
|
60
|
+
<h3>Frame colors</h3>
|
|
61
|
+
<div class="sketch-frame3 border-2 border-primary p-4 text-sm text-primary" style="display:inline-block;margin:4px;">primary</div>
|
|
62
|
+
<div class="sketch-frame5 border-2 border-secondary p-4 text-sm text-secondary" style="display:inline-block;margin:4px;">secondary</div>
|
|
63
|
+
<div class="sketch-frame7 border-2 border-success p-4 text-sm text-success" style="display:inline-block;margin:4px;">success</div>
|
|
64
|
+
<div class="sketch-frame9 border-2 border-error p-4 text-sm text-error" style="display:inline-block;margin:4px;">error</div>
|
|
65
|
+
<div class="sketch-frame3 border-2 border-red-500 p-4 text-sm text-red-600" style="display:inline-block;margin:4px;">red</div>
|
|
66
|
+
<div class="sketch-frame5 border-2 border-blue-500 p-4 text-sm text-blue-600" style="display:inline-block;margin:4px;">blue</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<h2 id="underline">Underline</h2>
|
|
71
|
+
<div class="section">
|
|
72
|
+
<div>
|
|
73
|
+
<h3>sketch-underline (default)</h3>
|
|
74
|
+
<span class="sketch-underline text-xl font-bold">Hand-drawn underline</span>
|
|
75
|
+
</div>
|
|
76
|
+
<div>
|
|
77
|
+
<h3>sketch-underline-1px (thin)</h3>
|
|
78
|
+
<span class="sketch-underline sketch-underline-1px text-xl font-bold">1px thin underline</span>
|
|
79
|
+
</div>
|
|
80
|
+
<div>
|
|
81
|
+
<h3>Colored underline</h3>
|
|
82
|
+
<span class="sketch-underline sketch-underline-primary text-xl font-bold mr-6">primary</span>
|
|
83
|
+
<span class="sketch-underline sketch-underline-success text-xl font-bold mr-6">success</span>
|
|
84
|
+
<span class="sketch-underline sketch-underline-error text-xl font-bold">error</span>
|
|
85
|
+
</div>
|
|
86
|
+
<div>
|
|
87
|
+
<h3>Different font sizes</h3>
|
|
88
|
+
<span class="sketch-underline sketch-underline-primary text-2xl font-bold" style="display:block;">Large text</span>
|
|
89
|
+
<span class="sketch-underline sketch-underline-success text-lg font-bold" style="display:block;">Medium text</span>
|
|
90
|
+
<span class="sketch-underline sketch-underline-error text-sm">Small text</span>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<h2 id="highlight-sketch-mark">Highlight (sketch-mark)</h2>
|
|
95
|
+
<div class="section">
|
|
96
|
+
<div>
|
|
97
|
+
<h3>Default</h3>
|
|
98
|
+
<span class="sketch-mark text-lg font-bold px-1">Hand-drawn highlight</span>
|
|
99
|
+
</div>
|
|
100
|
+
<div>
|
|
101
|
+
<h3>Colored highlight</h3>
|
|
102
|
+
<span class="sketch-mark sketch-mark-warning text-lg font-bold px-1 mr-4">warning</span>
|
|
103
|
+
<span class="sketch-mark sketch-mark-success text-lg font-bold px-1 mr-4">success</span>
|
|
104
|
+
<span class="sketch-mark sketch-mark-error text-lg font-bold px-1">error</span>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<h2 id="strikethrough-sketch-through">Strikethrough (sketch-through)</h2>
|
|
109
|
+
<div class="section">
|
|
110
|
+
<div>
|
|
111
|
+
<h3>Default</h3>
|
|
112
|
+
<span class="sketch-through text-lg font-bold">Hand-drawn strikethrough</span>
|
|
113
|
+
</div>
|
|
114
|
+
<div>
|
|
115
|
+
<h3>sketch-through-1px (thin)</h3>
|
|
116
|
+
<span class="sketch-through sketch-through-1px text-lg font-bold">1px thin strikethrough</span>
|
|
117
|
+
</div>
|
|
118
|
+
<div>
|
|
119
|
+
<h3>Colored strikethrough</h3>
|
|
120
|
+
<span class="sketch-through sketch-through-error text-lg font-bold mr-6">error</span>
|
|
121
|
+
<span class="sketch-through sketch-through-primary text-lg font-bold mr-6">primary</span>
|
|
122
|
+
<span class="sketch-through sketch-through-success text-lg font-bold">success</span>
|
|
123
|
+
</div>
|
|
124
|
+
<div>
|
|
125
|
+
<h3>Different font sizes</h3>
|
|
126
|
+
<span class="sketch-through sketch-through-error text-2xl font-bold" style="display:block;">Large</span>
|
|
127
|
+
<span class="sketch-through sketch-through-primary text-lg font-bold" style="display:block;">Medium</span>
|
|
128
|
+
<span class="sketch-through sketch-through-success text-sm">Small</span>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<h2 id="circle-mark-sketch-circling">Circle mark (sketch-circling)</h2>
|
|
133
|
+
<div class="section">
|
|
134
|
+
<div>
|
|
135
|
+
<h3>Default</h3>
|
|
136
|
+
<span class="sketch-circling text-lg font-bold">Hand-drawn circle</span>
|
|
137
|
+
</div>
|
|
138
|
+
<div>
|
|
139
|
+
<h3>sketch-circling-1px (thin)</h3>
|
|
140
|
+
<span class="sketch-circling sketch-circling-1px text-lg font-bold">1px thin circle</span>
|
|
141
|
+
</div>
|
|
142
|
+
<div>
|
|
143
|
+
<h3>Colored circle</h3>
|
|
144
|
+
<span class="sketch-circling sketch-circling-error text-lg font-bold mr-6">error</span>
|
|
145
|
+
<span class="sketch-circling sketch-circling-primary text-lg font-bold mr-6">primary</span>
|
|
146
|
+
<span class="sketch-circling sketch-circling-warning text-lg font-bold">warning</span>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<h2 id="wrong-cross-sketch-wrong">Wrong cross (sketch-wrong)</h2>
|
|
151
|
+
<div class="section">
|
|
152
|
+
<div>
|
|
153
|
+
<h3>Default</h3>
|
|
154
|
+
<span class="sketch-wrong text-lg font-bold">Hand-drawn cross</span>
|
|
155
|
+
</div>
|
|
156
|
+
<div>
|
|
157
|
+
<h3>sketch-wrong-1px (thin)</h3>
|
|
158
|
+
<span class="sketch-wrong sketch-wrong-1px text-lg font-bold">1px thin cross</span>
|
|
159
|
+
</div>
|
|
160
|
+
<div>
|
|
161
|
+
<h3>Colored cross</h3>
|
|
162
|
+
<span class="sketch-wrong sketch-wrong-error text-lg font-bold mr-6">error</span>
|
|
163
|
+
<span class="sketch-wrong sketch-wrong-primary text-lg font-bold mr-6">primary</span>
|
|
164
|
+
<span class="sketch-wrong sketch-wrong-warning text-lg font-bold">warning</span>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<h2 id="divider">Divider</h2>
|
|
169
|
+
<div class="section">
|
|
170
|
+
<div>
|
|
171
|
+
<h3>sketch-divider (horizontal)</h3>
|
|
172
|
+
<span class="text-sm">Above</span>
|
|
173
|
+
<div class="sketch-divider my-2"></div>
|
|
174
|
+
<span class="text-sm">Below</span>
|
|
175
|
+
</div>
|
|
176
|
+
<div>
|
|
177
|
+
<h3>sketch-divider-1px (thin)</h3>
|
|
178
|
+
<span class="text-sm">Above</span>
|
|
179
|
+
<div class="sketch-divider sketch-divider-1px my-2"></div>
|
|
180
|
+
<span class="text-sm">Below</span>
|
|
181
|
+
</div>
|
|
182
|
+
<div>
|
|
183
|
+
<h3>Colored divider</h3>
|
|
184
|
+
<div class="sketch-divider sketch-divider-primary"></div>
|
|
185
|
+
<div class="sketch-divider sketch-divider-success"></div>
|
|
186
|
+
<div class="sketch-divider sketch-divider-error"></div>
|
|
187
|
+
</div>
|
|
188
|
+
<div>
|
|
189
|
+
<h3>sketch-divider-v (vertical)</h3>
|
|
190
|
+
<div style="height:80px;display:flex;gap:16px;align-items:center;">
|
|
191
|
+
<span>Left</span>
|
|
192
|
+
<div class="sketch-divider-v h-full"></div>
|
|
193
|
+
<span>Center</span>
|
|
194
|
+
<div class="sketch-divider-v sketch-divider-primary h-full"></div>
|
|
195
|
+
<span>Right</span>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<h2 id="combination-example">Combination example</h2>
|
|
201
|
+
<div class="section">
|
|
202
|
+
<div class="sketch-frame5 border-2 border-primary p-6" style="max-width:500px;">
|
|
203
|
+
<h3 class="sketch-underline sketch-underline-primary text-xl font-bold mb-4">Sketch Card</h3>
|
|
204
|
+
<p class="text-sm mb-3">A card with a sketch frame, <span class="sketch-mark sketch-mark-warning font-bold">highlighted</span> text, and a divider.</p>
|
|
205
|
+
<div class="sketch-divider sketch-divider-primary my-3"></div>
|
|
206
|
+
<p class="text-sm">— Sketch style demo</p>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<script src="./demo-utils.js"></script>
|
|
211
|
+
</body>
|
|
212
|
+
|
|
213
|
+
</html>
|