wispcss 1.0.4 → 1.0.6

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.
@@ -104,7 +104,8 @@
104
104
  <a class="card" href="demo-avatar.html"><span class="name">Avatar</span><span class="desc">User avatar</span></a>
105
105
  <a class="card" href="demo-poster.html"><span class="name">Poster</span><span class="desc">Image poster with aspect ratio</span></a>
106
106
  <a class="card" href="demo-table.html"><span class="name">Table</span><span class="desc">Table styling</span></a>
107
- <a class="card" href="demo-icon.html"><span class="name">Icon</span><span class="desc">Mask-image icons</span></a>
107
+ <a class="card" href="demo-gtable.html"><span class="name">Grid Table</span><span class="desc">Grid-based table</span></a>
108
+ <a class="card" href="demo-icons.html"><span class="name">Icon</span><span class="desc">Mask-image icons</span></a>
108
109
  <a class="card" href="demo-swatch.html"><span class="name">Swatch</span><span class="desc">Color swatch</span></a>
109
110
  <a class="card" href="demo-entry.html"><span class="name">Entry</span><span class="desc">Single-line list item</span></a>
110
111
  <a class="card" href="demo-bubble.html"><span class="name">Bubble</span><span class="desc">Floating tooltip bubble</span></a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wispcss",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,6 +41,7 @@
41
41
  "scripts": {
42
42
  "dev": "npx @tailwindcss/cli -i ./src/index.css -o ./dist/wispcss.css --watch",
43
43
  "gen-color": "node script-gen-color.js",
44
+ "icons": "node script-demo-icons.js",
44
45
  "prefix": "node script-prefix.js",
45
46
  "mini": "node script-mini.js",
46
47
  "pack": "node script-pack.js",
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
3
  /**
4
- * Last modified: 2026/07/31 17:04:55
4
+ * Last modified: 2026/11/02 18:29:09
5
5
  */
6
6
 
7
7
  import fs from 'fs';
@@ -38,14 +38,14 @@ const getLightColors = function (color) {
38
38
  --color-${color}-active: oklch(from var(--color-${color}) calc(l * 0.9) c h);
39
39
  --color-${color}-contrast: oklch(from var(--color-${color}) clamp(var(--light-min), (var(--light-threshold-contrast) - l) * 100, var(--light-max)) 0 0);
40
40
  --color-${color}-body: oklch(from var(--color-${color}) min(var(--light-threshold-body),l) c h);
41
- --color-${color}-surface: oklch(from var(--color-${color}) var(--light-threshold-surface) min(var(--chorme-surface),c ) h);
41
+ --color-${color}-surface: oklch(from var(--color-${color}) var(--light-threshold-surface) min(var(--chroma-surface),c ) h);
42
42
  --color-${color}-fg: oklch(from var(--color-${color}) min(var(--light-threshold-fg),l) c h);
43
- --color-${color}-bg: oklch(from var(--color-${color}) var(--light-threshold-bg) min(var(--chorme-bg),c) h);
44
- --color-${color}-bg-hover: oklch(from var(--color-${color}) var(--light-threshold-bg-hover) min(var(--chorme-bg-hover),c) h);
45
- --color-${color}-bg-active:oklch(from var(--color-${color}) var(--light-threshold-bg-active) min(var(--chorme-bg-active),c) h);
46
- --color-${color}-bd: oklch(from var(--color-${color}) var(--light-threshold-bd) min(var(--chorme-bd),c ) h);
47
- --color-${color}-bd-hover: oklch(from var(--color-${color}) var(--light-threshold-bd-hover) min(var(--chorme-bd-hover),c ) h);
48
- --color-${color}-bd-active: oklch(from var(--color-${color}) var(--light-threshold-bd-active) min(var(--chorme-bd-active),c ) h);
43
+ --color-${color}-bg: oklch(from var(--color-${color}) var(--light-threshold-bg) min(var(--chroma-bg),c) h);
44
+ --color-${color}-bg-hover: oklch(from var(--color-${color}) var(--light-threshold-bg-hover) min(var(--chroma-bg-hover),c) h);
45
+ --color-${color}-bg-active:oklch(from var(--color-${color}) var(--light-threshold-bg-active) min(var(--chroma-bg-active),c) h);
46
+ --color-${color}-bd: oklch(from var(--color-${color}) var(--light-threshold-bd) min(var(--chroma-bd),c ) h);
47
+ --color-${color}-bd-hover: oklch(from var(--color-${color}) var(--light-threshold-bd-hover) min(var(--chroma-bd-hover),c ) h);
48
+ --color-${color}-bd-active: oklch(from var(--color-${color}) var(--light-threshold-bd-active) min(var(--chroma-bd-active),c ) h);
49
49
  `;
50
50
  let getAltColors = (color) => `
51
51
  --color-${color}-base: oklch(from var(--color-title) calc(l * ${color === 'description' ? 2.5 : color === 'caption' ? 3.5 : color === 'placeholder' ? 4.5 : 1}) c h);
package/script-mini.js CHANGED
@@ -1,15 +1,14 @@
1
1
  /**
2
- * Last modified: 2026/11/02 11:05:00
2
+ * Last modified: 2026/11/02 14:02:04
3
3
  *
4
- * CSS 压缩脚本 - 将 dist 目录下的每个 CSS 文件压缩为同名 .min.css 文件
5
- * dist/wispcss.css -> dist/wispcss.min.css
6
- * *.min.css 不会被再次压缩,因此脚本可重复执行。
4
+ * Minify every CSS file in `dist` into a sibling `.min.css` file
5
+ * (dist/wispcss.css -> dist/wispcss.min.css). Existing `*.min.css` files are skipped,
6
+ * so the script can be re-run safely.
7
7
  *
8
- * 使用 lightningcss(Tailwind v4 内部使用的同一个压缩器)。
9
- * 说明:clean-css(cleancss) 无法解析 Tailwind v4 产物的现代语法,
10
- * 在 tokenizer 阶段会直接抛异常,因此不再使用。
8
+ * Uses lightningcss — the same minifier Tailwind v4 relies on. clean-css (cleancss) cannot
9
+ * parse Tailwind v4 output and throws inside its tokenizer, so it is no longer used.
11
10
  *
12
- * 使用方式:node script-mini.js 或 npm run mini
11
+ * Usage: node script-mini.js (or: npm run mini)
13
12
  */
14
13
  import { existsSync, readFileSync, readdirSync, writeFileSync } from 'fs';
15
14
  import path from 'path';
@@ -34,7 +33,7 @@ const minifyCss = () => {
34
33
  process.exit(1);
35
34
  }
36
35
 
37
- // 只处理 .css,跳过压缩产物 *.min.css
36
+ // Plain .css only; skip existing *.min.css
38
37
  const files = readdirSync(DIST_DIR, { withFileTypes: true })
39
38
  .filter((entry) => entry.isFile())
40
39
  .map((entry) => entry.name)
package/script-prefix.js CHANGED
@@ -6,15 +6,15 @@
6
6
  * What it does (CSS files only):
7
7
  * 1. Copy the whole `src` directory to `src-prefix` (an existing copy is removed first).
8
8
  * 2. In `src-prefix/index.css`, rewrite `@import "tailwindcss";`
9
- * to `@import "tailwindcss" prefix(tw);`.
9
+ * to `@import "tailwindcss" prefix(wi);`.
10
10
  * 3. Prefix every class name of each `@apply` statement in all CSS files under `src-prefix`.
11
11
  * 4. Prefix static class selectors in rule headers, including `:where()`, `:not()`, `:has()` and `:is()`:
12
12
  * @apply transition-all-normal inline-flex-center background-cover;
13
- * -> @apply tw:transition-all-normal tw:inline-flex-center tw:background-cover;
14
- * &:where(.check-subtle, .check-ghost) -> &:where(.tw\:check-subtle, .tw\:check-ghost)
13
+ * -> @apply wi:transition-all-normal wi:inline-flex-center wi:background-cover;
14
+ * &:where(.check-subtle, .check-ghost) -> &:where(.wi\:check-subtle, .wi\:check-ghost)
15
15
  *
16
16
  * Tailwind v4 requires prefixed class names inside @apply as well, otherwise compilation fails:
17
- * Cannot apply unprefixed utility class `xxx`. Did you mean `tw:xxx`?
17
+ * Cannot apply unprefixed utility class `xxx`. Did you mean `wi:xxx`?
18
18
  *
19
19
  * Note: `@apply` occurrences inside comments or strings are left untouched.
20
20
  */
@@ -28,7 +28,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
28
28
  const SRC_DIR = path.join(__dirname, 'src');
29
29
  const DEST_DIR = path.join(__dirname, 'src-prefix');
30
30
  const ENTRY_FILE = 'index.css';
31
- const DEFAULT_PREFIX = 'tw';
31
+ const DEFAULT_PREFIX = 'wi';
32
32
  const APPLY = '@apply';
33
33
 
34
34
  /* ============================================
@@ -119,7 +119,7 @@ const prefixClassList = (value, prefix) => {
119
119
 
120
120
  /**
121
121
  * Prefix static class selectors in CSS rule headers.
122
- * The returned selector uses a CSS-escaped colon: `.tw\\:class-name`.
122
+ * The returned selector uses a CSS-escaped colon: `.wi\\:class-name`.
123
123
  */
124
124
  const prefixSelectorClasses = (selector, prefix) => {
125
125
  let result = '';
@@ -1,164 +0,0 @@
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>Icon - WispCSS Demo</title>
10
- </head>
11
-
12
- <body>
13
- <h1>Icon Component</h1>
14
- <p>Vector icons implemented with CSS mask-image. Color via <code>text-*</code> or <code>icon-*</code> utilities. Supports multiple icon families, sizes, and custom colors.</p>
15
-
16
- <h2>Notes</h2>
17
- <div class="section">
18
- <ul>
19
- <li>Base class: <code>.icon</code>. Shape class: <code>icon-*</code> (e.g. <code>icon-check</code>).</li>
20
- <li>Icon color follows <code>currentColor</code> by default. Use <code>text-*</code> utilities or inline <code>style="color:..."</code> to set color.</li>
21
- <li>Sizes via <code>icon-*</code> dynamic utilities (e.g. <code>icon-6</code>, <code>icon-10</code>, <code>icon-20</code>, <code>icon-[28px]</code>).</li>
22
- <li>More icons will be added in future releases.</li>
23
- </ul>
24
- </div>
25
-
26
- <h2 id="basic">Basic usage</h2>
27
- <div class="section">
28
- <div>
29
- <h3>Default icons</h3>
30
- <span class="icon icon-check"></span>
31
- <span class="icon icon-close"></span>
32
- <span class="icon icon-info"></span>
33
- <span class="icon icon-warning"></span>
34
- <span class="icon icon-chevron-start"></span>
35
- </div>
36
- <div>
37
- <h3>With color (text-*)</h3>
38
- <span class="icon icon-check-circle-fill text-success"></span>
39
- <span class="icon icon-close-circle-fill text-error"></span>
40
- <span class="icon icon-info-circle-fill text-info"></span>
41
- <span class="icon icon-warning-triangle-fill text-warning"></span>
42
- </div>
43
- <div>
44
- <h3>Icon + text</h3>
45
- <span class="icon icon-check-circle-fill text-success"></span> Success
46
- <span class="icon icon-close-circle-fill text-error"></span> Error
47
- <span class="icon icon-info-circle-fill text-info"></span> Info
48
- <span class="icon icon-warning-triangle-fill text-warning"></span> Warning
49
- </div>
50
- </div>
51
-
52
- <h2 id="icon-families">Icon families</h2>
53
- <div class="section">
54
- <div>
55
- <h3>Check</h3>
56
- <span class="icon icon-check icon-2xl text-success"></span> check
57
- <span class="icon icon-check-circle icon-2xl text-success"></span> check-pill
58
- <span class="icon icon-check-circle-fill icon-2xl text-success"></span> check-pill-fill
59
- </div>
60
- <div>
61
- <h3>Close</h3>
62
- <span class="icon icon-close icon-2xl text-error"></span> close
63
- <span class="icon icon-close-circle icon-2xl text-error"></span> close-circle
64
- <span class="icon icon-close-circle-fill icon-2xl text-error"></span> close-circle-fill
65
- </div>
66
- <div>
67
- <h3>Warning / triangle</h3>
68
- <span class="icon icon-warning icon-2xl text-warning"></span> warning
69
- <span class="icon icon-warning-triangle icon-2xl text-warning"></span> warning-triangle
70
- <span class="icon icon-warning-triangle-fill icon-2xl text-warning"></span> warning-triangle-fill
71
- </div>
72
- <div>
73
- <h3>Question / help</h3>
74
- <span class="icon icon-warning icon-2xl text-help"></span> warning
75
- <span class="icon icon-warning-circle icon-2xl text-help"></span> warning-circle
76
- <span class="icon icon-warning-circle-fill icon-2xl text-help"></span> warning-circle-fill
77
- </div>
78
- <div>
79
- <h3>Info</h3>
80
- <span class="icon icon-info icon-2xl text-info"></span> info
81
- <span class="icon icon-info-circle icon-2xl text-info"></span> info-circle
82
- <span class="icon icon-info-circle-fill icon-2xl text-info"></span> info-circle-fill
83
- </div>
84
- <div>
85
- <h3>Chevron down</h3>
86
- <span class="icon icon-chevron-down icon-2xl"></span> chevron-down
87
- <span class="icon icon-chevron-down-circle icon-2xl"></span> chevron-down-circle
88
- <span class="icon icon-chevron-down-circle-fill icon-2xl"></span> chevron-down-circle-fill
89
- </div>
90
- <div>
91
- <h3>Plus</h3>
92
- <span class="icon icon-plus icon-2xl"></span> plus
93
- <span class="icon icon-plus-circle icon-2xl"></span> plus-circle
94
- <span class="icon icon-plus-circle-fill icon-2xl"></span> plus-circle-fill
95
- </div>
96
- </div>
97
-
98
- <h2 id="sizes">Sizes</h2>
99
- <div class="section">
100
- <div>
101
- <h3>Custom via icon-*</h3>
102
- <span class="icon icon-check-circle-fill icon-6"></span>
103
- <span class="icon icon-check-circle-fill icon-10"></span>
104
- <span class="icon icon-check-circle-fill icon-[28px]"></span>
105
- </div>
106
- </div>
107
-
108
- <h2 id="theme-colors">Theme colors</h2>
109
- <div class="section">
110
- <div>
111
- <span class="icon icon-info-circle-fill icon-3xl"></span> default
112
- <span class="icon icon-info-circle-fill icon-3xl text-primary"></span> primary
113
- <span class="icon icon-info-circle-fill icon-3xl text-secondary"></span> secondary
114
- <span class="icon icon-info-circle-fill icon-3xl text-tertiary"></span> tertiary
115
- <span class="icon icon-check-circle-fill icon-3xl text-success"></span> success
116
- <span class="icon icon-close-circle-fill icon-3xl text-error"></span> error
117
- <span class="icon icon-info-circle-fill icon-3xl text-info"></span> info
118
- <span class="icon icon-warning-triangle-fill icon-3xl text-warning"></span> warning
119
- <span class="icon icon-warning-circle-fill icon-3xl text-help"></span> help
120
- <span class="icon icon-info-circle-fill icon-3xl text-ink"></span> ink
121
- <span class="icon icon-info-circle-fill icon-3xl text-title"></span> title
122
- <span class="icon icon-info-circle-fill icon-3xl text-description"></span> description
123
- <span class="icon icon-info-circle-fill icon-3xl text-caption"></span> caption
124
- <span class="icon icon-info-circle-fill icon-3xl text-placeholder"></span> disabled
125
- </div>
126
- </div>
127
-
128
- <h2 id="custom-colors">Custom colors</h2>
129
- <div class="section">
130
- <p>Icon color follows the text color — use <code>style="color:..."</code> or <code>text-*</code> utilities.</p>
131
- <div>
132
- <span class="icon icon-check-circle-fill" style="color:blue"></span>
133
- <span class="icon icon-check-circle-fill text-success"></span>
134
- </div>
135
- </div>
136
-
137
- <h2 id="use-cases">Use cases</h2>
138
- <div class="section">
139
- <div>
140
- <h3>Status indicators</h3>
141
- <span class="icon icon-check-circle-fill icon-sm text-success"></span> Upload successful
142
- <span class="icon icon-close-circle-fill icon-sm text-error"></span> Upload failed
143
- <span class="icon icon-warning-triangle-fill icon-sm text-warning"></span> Disk space low
144
- <span class="icon icon-info-circle-fill icon-sm text-info"></span> Update available
145
- </div>
146
- <div>
147
- <h3>Button icons</h3>
148
- <span class="icon icon-check icon-4xs"></span> Save
149
- <span class="icon icon-close icon-4xs"></span> Delete
150
- <span class="icon icon-info-circle icon-4xs text-info"></span> Details
151
- </div>
152
- <div>
153
- <h3>Form validation</h3>
154
- <span class="icon icon-check-circle-fill icon-sm text-success"></span> Username available
155
- <span class="icon icon-close-circle-fill icon-sm text-error"></span> Password too weak
156
- <span class="icon icon-info-circle-fill icon-sm text-info"></span> Email format OK
157
- <span class="icon icon-warning-triangle-fill icon-sm text-warning"></span> Code expiring
158
- </div>
159
- </div>
160
-
161
- <script src="./demo-utils.js"></script>
162
- </body>
163
-
164
- </html>