@weapp-tailwindcss/reset 0.1.0 → 0.1.1-next.1

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/dist/index.cjs CHANGED
@@ -1,311 +1,268 @@
1
- "use strict";
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ //#region \0rolldown/runtime.js
2
6
  var __create = Object.create;
3
7
  var __defProp = Object.defineProperty;
4
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
9
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
10
  var __getProtoOf = Object.getPrototypeOf;
7
11
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
12
  var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
+ key = keys[i];
15
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: ((k) => from[k]).bind(null, key),
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
19
21
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- default: () => index_default,
34
- reset: () => reset
35
- });
36
- module.exports = __toCommonJS(index_exports);
37
- var import_plugin = __toESM(require("tailwindcss/plugin"));
38
-
39
- // src/normalize.ts
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+ //#endregion
27
+ let tailwindcss_plugin = require("tailwindcss/plugin");
28
+ tailwindcss_plugin = __toESM(tailwindcss_plugin);
29
+ //#region src/normalize.ts
40
30
  function normalizeResetSelectors(option, defaults) {
41
- const resolved = option?.selectors?.length ? option.selectors : defaults;
42
- const normalized = [];
43
- for (const selector of resolved) {
44
- const trimmed = selector.trim();
45
- if (!trimmed || normalized.includes(trimmed)) {
46
- continue;
47
- }
48
- normalized.push(trimmed);
49
- }
50
- return normalized.length ? normalized : void 0;
31
+ const resolved = option?.selectors?.length ? option.selectors : defaults;
32
+ const normalized = [];
33
+ for (const selector of resolved) {
34
+ const trimmed = selector.trim();
35
+ if (!trimmed || normalized.includes(trimmed)) continue;
36
+ normalized.push(trimmed);
37
+ }
38
+ return normalized.length ? normalized : void 0;
51
39
  }
52
40
  function convertSelectorForBase(selector) {
53
- if (selector.startsWith(".")) {
54
- const className = selector.slice(1);
55
- if (className.length > 0) {
56
- return `[class~="${className}"]`;
57
- }
58
- }
59
- if (selector.startsWith("#")) {
60
- const id = selector.slice(1);
61
- if (id.length > 0) {
62
- return `[id="${id}"]`;
63
- }
64
- }
65
- return selector;
41
+ if (selector.startsWith(".")) {
42
+ const className = selector.slice(1);
43
+ if (className.length > 0) return `[class~="${className}"]`;
44
+ }
45
+ if (selector.startsWith("#")) {
46
+ const id = selector.slice(1);
47
+ if (id.length > 0) return `[id="${id}"]`;
48
+ }
49
+ return selector;
66
50
  }
67
51
  function normalizeDeclarationValue(value) {
68
- if (value === false || value === null || value === void 0) {
69
- return void 0;
70
- }
71
- return typeof value === "number" ? value.toString() : value;
52
+ if (value === false || value === null || value === void 0) return;
53
+ return typeof value === "number" ? value.toString() : value;
72
54
  }
73
55
  function normalizeDeclarations(option, defaults) {
74
- const normalized = { ...defaults };
75
- const overrides = option?.declarations;
76
- if (!overrides) {
77
- return normalized;
78
- }
79
- const entries = Object.entries(overrides);
80
- for (const [prop, value] of entries) {
81
- const resolved = normalizeDeclarationValue(value);
82
- if (resolved === void 0) {
83
- delete normalized[prop];
84
- } else {
85
- normalized[prop] = resolved;
86
- }
87
- }
88
- return normalized;
56
+ const normalized = { ...defaults };
57
+ const overrides = option?.declarations;
58
+ if (!overrides) return normalized;
59
+ const entries = Object.entries(overrides);
60
+ for (const [prop, value] of entries) {
61
+ const resolved = normalizeDeclarationValue(value);
62
+ if (resolved === void 0) delete normalized[prop];
63
+ else normalized[prop] = resolved;
64
+ }
65
+ return normalized;
89
66
  }
90
67
  function normalizePseudo(option, defaults) {
91
- const normalized = defaults ? { ...defaults } : {};
92
- const overrides = option?.pseudo;
93
- if (!overrides) {
94
- return Object.keys(normalized).length ? normalized : void 0;
95
- }
96
- const entries = Object.entries(overrides);
97
- for (const [prop, value] of entries) {
98
- const resolved = normalizeDeclarationValue(value);
99
- if (resolved === void 0) {
100
- delete normalized[prop];
101
- } else {
102
- normalized[prop] = resolved;
103
- }
104
- }
105
- return Object.keys(normalized).length ? normalized : void 0;
68
+ const normalized = defaults ? { ...defaults } : {};
69
+ const overrides = option?.pseudo;
70
+ if (!overrides) return Object.keys(normalized).length ? normalized : void 0;
71
+ const entries = Object.entries(overrides);
72
+ for (const [prop, value] of entries) {
73
+ const resolved = normalizeDeclarationValue(value);
74
+ if (resolved === void 0) delete normalized[prop];
75
+ else normalized[prop] = resolved;
76
+ }
77
+ return Object.keys(normalized).length ? normalized : void 0;
106
78
  }
107
79
  function createResetRule(option, defaults) {
108
- if (option === false) {
109
- return void 0;
110
- }
111
- const selectors = normalizeResetSelectors(option, defaults.selectors);
112
- if (!selectors) {
113
- return void 0;
114
- }
115
- const declarations = normalizeDeclarations(option ?? {}, defaults.declarations);
116
- if (Object.keys(declarations).length === 0) {
117
- return void 0;
118
- }
119
- const pseudo = normalizePseudo(option ?? {}, defaults.pseudo);
120
- return {
121
- selectors: selectors.map(convertSelectorForBase),
122
- declarations,
123
- pseudo
124
- };
80
+ if (option === false) return;
81
+ const selectors = normalizeResetSelectors(option, defaults.selectors);
82
+ if (!selectors) return;
83
+ const declarations = normalizeDeclarations(option ?? {}, defaults.declarations);
84
+ if (Object.keys(declarations).length === 0) return;
85
+ const pseudo = normalizePseudo(option ?? {}, defaults.pseudo);
86
+ return {
87
+ selectors: selectors.map(convertSelectorForBase),
88
+ declarations,
89
+ pseudo
90
+ };
125
91
  }
126
-
127
- // src/index.ts
128
- var DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
129
- var DEFAULT_BUTTON_DECLARATIONS = {
130
- padding: "0",
131
- backgroundColor: "transparent",
132
- fontSize: "inherit",
133
- lineHeight: "inherit",
134
- color: "inherit",
135
- borderWidth: "0"
136
- };
137
- var BUTTON_RESET_PSEUDO_DECLARATIONS = {
138
- border: "none"
92
+ //#endregion
93
+ //#region src/index.ts
94
+ const DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
95
+ const DEFAULT_BUTTON_DECLARATIONS = {
96
+ padding: "0",
97
+ backgroundColor: "transparent",
98
+ fontSize: "inherit",
99
+ lineHeight: "inherit",
100
+ color: "inherit",
101
+ borderWidth: "0"
139
102
  };
140
- var DEFAULT_IMAGE_RESET_SELECTORS = ["image", "img"];
141
- var DEFAULT_IMAGE_DECLARATIONS = {
142
- display: "block",
143
- borderWidth: "0",
144
- backgroundColor: "transparent",
145
- maxWidth: "100%",
146
- height: "auto"
103
+ const BUTTON_RESET_PSEUDO_DECLARATIONS = { border: "none" };
104
+ const DEFAULT_IMAGE_RESET_SELECTORS = ["image", "img"];
105
+ const DEFAULT_IMAGE_DECLARATIONS = {
106
+ display: "block",
107
+ borderWidth: "0",
108
+ backgroundColor: "transparent",
109
+ maxWidth: "100%",
110
+ height: "auto"
147
111
  };
148
- var DEFAULT_INPUT_RESET_SELECTORS = ["input"];
149
- var DEFAULT_INPUT_DECLARATIONS = {
150
- padding: "0",
151
- fontSize: "100%",
152
- fontFamily: "inherit",
153
- lineHeight: "inherit",
154
- color: "inherit",
155
- backgroundColor: "transparent",
156
- borderWidth: "0"
112
+ const DEFAULT_INPUT_RESET_SELECTORS = ["input"];
113
+ const DEFAULT_INPUT_DECLARATIONS = {
114
+ padding: "0",
115
+ fontSize: "100%",
116
+ fontFamily: "inherit",
117
+ lineHeight: "inherit",
118
+ color: "inherit",
119
+ backgroundColor: "transparent",
120
+ borderWidth: "0"
157
121
  };
158
- var DEFAULT_TEXTAREA_RESET_SELECTORS = ["textarea"];
159
- var DEFAULT_TEXTAREA_DECLARATIONS = {
160
- padding: "0",
161
- fontSize: "100%",
162
- fontFamily: "inherit",
163
- lineHeight: "inherit",
164
- color: "inherit",
165
- backgroundColor: "transparent",
166
- borderWidth: "0",
167
- resize: "vertical"
122
+ const DEFAULT_TEXTAREA_RESET_SELECTORS = ["textarea"];
123
+ const DEFAULT_TEXTAREA_DECLARATIONS = {
124
+ padding: "0",
125
+ fontSize: "100%",
126
+ fontFamily: "inherit",
127
+ lineHeight: "inherit",
128
+ color: "inherit",
129
+ backgroundColor: "transparent",
130
+ borderWidth: "0",
131
+ resize: "vertical"
168
132
  };
169
- var DEFAULT_LIST_RESET_SELECTORS = ["ul", "ol"];
170
- var DEFAULT_LIST_DECLARATIONS = {
171
- listStyle: "none",
172
- margin: "0",
173
- padding: "0"
133
+ const DEFAULT_LIST_RESET_SELECTORS = ["ul", "ol"];
134
+ const DEFAULT_LIST_DECLARATIONS = {
135
+ listStyle: "none",
136
+ margin: "0",
137
+ padding: "0"
174
138
  };
175
- var DEFAULT_NAVIGATOR_RESET_SELECTORS = ["navigator", "a"];
176
- var DEFAULT_NAVIGATOR_DECLARATIONS = {
177
- color: "inherit",
178
- textDecoration: "inherit"
139
+ const DEFAULT_NAVIGATOR_RESET_SELECTORS = ["navigator", "a"];
140
+ const DEFAULT_NAVIGATOR_DECLARATIONS = {
141
+ color: "inherit",
142
+ textDecoration: "inherit"
179
143
  };
180
- var DEFAULT_VIDEO_RESET_SELECTORS = ["video"];
181
- var DEFAULT_VIDEO_DECLARATIONS = {
182
- display: "block",
183
- maxWidth: "100%",
184
- height: "auto"
144
+ const DEFAULT_VIDEO_RESET_SELECTORS = ["video"];
145
+ const DEFAULT_VIDEO_DECLARATIONS = {
146
+ display: "block",
147
+ maxWidth: "100%",
148
+ height: "auto"
185
149
  };
186
- var presetMap = {
187
- minimal: ["buttonReset", "imageReset"],
188
- form: ["buttonReset", "imageReset", "inputReset", "textareaReset"],
189
- content: ["buttonReset", "imageReset", "listReset", "navigatorReset"],
190
- media: ["buttonReset", "imageReset", "videoReset"],
191
- all: [
192
- "buttonReset",
193
- "imageReset",
194
- "inputReset",
195
- "textareaReset",
196
- "listReset",
197
- "navigatorReset",
198
- "videoReset"
199
- ]
150
+ const presetMap = {
151
+ minimal: ["buttonReset", "imageReset"],
152
+ form: [
153
+ "buttonReset",
154
+ "imageReset",
155
+ "inputReset",
156
+ "textareaReset"
157
+ ],
158
+ content: [
159
+ "buttonReset",
160
+ "imageReset",
161
+ "listReset",
162
+ "navigatorReset"
163
+ ],
164
+ media: [
165
+ "buttonReset",
166
+ "imageReset",
167
+ "videoReset"
168
+ ],
169
+ all: [
170
+ "buttonReset",
171
+ "imageReset",
172
+ "inputReset",
173
+ "textareaReset",
174
+ "listReset",
175
+ "navigatorReset",
176
+ "videoReset"
177
+ ]
200
178
  };
201
- var builtInResetKeys = [
202
- "buttonReset",
203
- "imageReset",
204
- "inputReset",
205
- "textareaReset",
206
- "listReset",
207
- "navigatorReset",
208
- "videoReset"
179
+ const builtInResetKeys = [
180
+ "buttonReset",
181
+ "imageReset",
182
+ "inputReset",
183
+ "textareaReset",
184
+ "listReset",
185
+ "navigatorReset",
186
+ "videoReset"
209
187
  ];
210
188
  function hasCustomResetConfig(value) {
211
- return value !== void 0 && value !== false;
189
+ return value !== void 0 && value !== false;
212
190
  }
213
191
  function resolvePresetFlags(options) {
214
- const resolved = {
215
- buttonReset: true,
216
- imageReset: true,
217
- inputReset: false,
218
- textareaReset: false,
219
- listReset: false,
220
- navigatorReset: false,
221
- videoReset: false
222
- };
223
- const presets = options?.preset;
224
- if (presets) {
225
- const normalizedPresets = Array.isArray(presets) ? presets : [presets];
226
- for (const preset of normalizedPresets) {
227
- for (const key of presetMap[preset]) {
228
- resolved[key] = true;
229
- }
230
- }
231
- }
232
- for (const key of builtInResetKeys) {
233
- if (hasCustomResetConfig(options?.[key])) {
234
- resolved[key] = true;
235
- }
236
- }
237
- return resolved;
192
+ const resolved = {
193
+ buttonReset: true,
194
+ imageReset: true,
195
+ inputReset: false,
196
+ textareaReset: false,
197
+ listReset: false,
198
+ navigatorReset: false,
199
+ videoReset: false
200
+ };
201
+ const presets = options?.preset;
202
+ if (presets) {
203
+ const normalizedPresets = Array.isArray(presets) ? presets : [presets];
204
+ for (const preset of normalizedPresets) for (const key of presetMap[preset]) resolved[key] = true;
205
+ }
206
+ for (const key of builtInResetKeys) if (hasCustomResetConfig(options?.[key])) resolved[key] = true;
207
+ return resolved;
238
208
  }
239
- var reset = import_plugin.default.withOptions(
240
- (options) => {
241
- const rules = [];
242
- const enabledFlags = resolvePresetFlags(options);
243
- const builtInRules = [
244
- enabledFlags.buttonReset ? createResetRule(options?.buttonReset, {
245
- selectors: DEFAULT_BUTTON_RESET_SELECTORS,
246
- declarations: DEFAULT_BUTTON_DECLARATIONS,
247
- pseudo: BUTTON_RESET_PSEUDO_DECLARATIONS
248
- }) : void 0,
249
- enabledFlags.imageReset ? createResetRule(options?.imageReset, {
250
- selectors: DEFAULT_IMAGE_RESET_SELECTORS,
251
- declarations: DEFAULT_IMAGE_DECLARATIONS
252
- }) : void 0,
253
- enabledFlags.inputReset ? createResetRule(options?.inputReset, {
254
- selectors: DEFAULT_INPUT_RESET_SELECTORS,
255
- declarations: DEFAULT_INPUT_DECLARATIONS
256
- }) : void 0,
257
- enabledFlags.textareaReset ? createResetRule(options?.textareaReset, {
258
- selectors: DEFAULT_TEXTAREA_RESET_SELECTORS,
259
- declarations: DEFAULT_TEXTAREA_DECLARATIONS
260
- }) : void 0,
261
- enabledFlags.listReset ? createResetRule(options?.listReset, {
262
- selectors: DEFAULT_LIST_RESET_SELECTORS,
263
- declarations: DEFAULT_LIST_DECLARATIONS
264
- }) : void 0,
265
- enabledFlags.navigatorReset ? createResetRule(options?.navigatorReset, {
266
- selectors: DEFAULT_NAVIGATOR_RESET_SELECTORS,
267
- declarations: DEFAULT_NAVIGATOR_DECLARATIONS
268
- }) : void 0,
269
- enabledFlags.videoReset ? createResetRule(options?.videoReset, {
270
- selectors: DEFAULT_VIDEO_RESET_SELECTORS,
271
- declarations: DEFAULT_VIDEO_DECLARATIONS
272
- }) : void 0
273
- ];
274
- for (const rule of builtInRules) {
275
- if (rule) {
276
- rules.push(rule);
277
- }
278
- }
279
- for (const extra of options?.extraResets ?? []) {
280
- const normalized = createResetRule(extra, {
281
- selectors: extra.selectors ?? [],
282
- declarations: {}
283
- });
284
- if (normalized) {
285
- rules.push(normalized);
286
- }
287
- }
288
- return ({ addBase }) => {
289
- if (!rules.length) {
290
- return;
291
- }
292
- const baseRules = {};
293
- for (const rule of rules) {
294
- baseRules[rule.selectors.join(",")] = rule.declarations;
295
- if (rule.pseudo) {
296
- const pseudoSelectors = rule.selectors.map((selector) => `${selector}::after`).join(",");
297
- baseRules[pseudoSelectors] = rule.pseudo;
298
- }
299
- }
300
- addBase(baseRules);
301
- };
302
- },
303
- () => {
304
- return {};
305
- }
306
- );
307
- var index_default = reset;
308
- // Annotate the CommonJS export names for ESM import in node:
309
- 0 && (module.exports = {
310
- reset
209
+ const reset = tailwindcss_plugin.default.withOptions((options) => {
210
+ const rules = [];
211
+ const enabledFlags = resolvePresetFlags(options);
212
+ const builtInRules = [
213
+ enabledFlags.buttonReset ? createResetRule(options?.buttonReset, {
214
+ selectors: DEFAULT_BUTTON_RESET_SELECTORS,
215
+ declarations: DEFAULT_BUTTON_DECLARATIONS,
216
+ pseudo: BUTTON_RESET_PSEUDO_DECLARATIONS
217
+ }) : void 0,
218
+ enabledFlags.imageReset ? createResetRule(options?.imageReset, {
219
+ selectors: DEFAULT_IMAGE_RESET_SELECTORS,
220
+ declarations: DEFAULT_IMAGE_DECLARATIONS
221
+ }) : void 0,
222
+ enabledFlags.inputReset ? createResetRule(options?.inputReset, {
223
+ selectors: DEFAULT_INPUT_RESET_SELECTORS,
224
+ declarations: DEFAULT_INPUT_DECLARATIONS
225
+ }) : void 0,
226
+ enabledFlags.textareaReset ? createResetRule(options?.textareaReset, {
227
+ selectors: DEFAULT_TEXTAREA_RESET_SELECTORS,
228
+ declarations: DEFAULT_TEXTAREA_DECLARATIONS
229
+ }) : void 0,
230
+ enabledFlags.listReset ? createResetRule(options?.listReset, {
231
+ selectors: DEFAULT_LIST_RESET_SELECTORS,
232
+ declarations: DEFAULT_LIST_DECLARATIONS
233
+ }) : void 0,
234
+ enabledFlags.navigatorReset ? createResetRule(options?.navigatorReset, {
235
+ selectors: DEFAULT_NAVIGATOR_RESET_SELECTORS,
236
+ declarations: DEFAULT_NAVIGATOR_DECLARATIONS
237
+ }) : void 0,
238
+ enabledFlags.videoReset ? createResetRule(options?.videoReset, {
239
+ selectors: DEFAULT_VIDEO_RESET_SELECTORS,
240
+ declarations: DEFAULT_VIDEO_DECLARATIONS
241
+ }) : void 0
242
+ ];
243
+ for (const rule of builtInRules) if (rule) rules.push(rule);
244
+ for (const extra of options?.extraResets ?? []) {
245
+ const normalized = createResetRule(extra, {
246
+ selectors: extra.selectors ?? [],
247
+ declarations: {}
248
+ });
249
+ if (normalized) rules.push(normalized);
250
+ }
251
+ return ({ addBase }) => {
252
+ if (!rules.length) return;
253
+ const baseRules = {};
254
+ for (const rule of rules) {
255
+ baseRules[rule.selectors.join(",")] = rule.declarations;
256
+ if (rule.pseudo) {
257
+ const pseudoSelectors = rule.selectors.map((selector) => `${selector}::after`).join(",");
258
+ baseRules[pseudoSelectors] = rule.pseudo;
259
+ }
260
+ }
261
+ addBase(baseRules);
262
+ };
263
+ }, () => {
264
+ return {};
311
265
  });
266
+ //#endregion
267
+ exports.default = reset;
268
+ exports.reset = reset;
package/dist/index.d.ts CHANGED
@@ -1,53 +1,61 @@
1
- import * as node_modules_tailwindcss_dist_types_CJYAW1ql_mjs from 'node_modules/tailwindcss/dist/types-CJYAW1ql.mjs';
2
-
1
+ //#region src/types.d.ts
3
2
  type ResetPreset = 'minimal' | 'form' | 'content' | 'media' | 'all';
4
3
  type BuiltInResetName = 'buttonReset' | 'imageReset' | 'inputReset' | 'textareaReset' | 'listReset' | 'navigatorReset' | 'videoReset';
5
4
  interface ResetOptions {
6
- /**
7
- * 启用一组内置 reset 预设;默认不传时保持最小行为,仅注入 button/image。
8
- */
9
- preset?: ResetPreset | ResetPreset[];
10
- /**
11
- * 控制 `button` reset 的注入与选择器,传入 `false` 可跳过该规则。
12
- */
13
- buttonReset?: false | ResetConfig;
14
- /**
15
- * 控制 `image` reset(同时覆盖 `<image>` 与 `<img>`)。
16
- */
17
- imageReset?: false | ResetConfig;
18
- /**
19
- * 控制常见输入框 reset(`input`)。
20
- */
21
- inputReset?: false | ResetConfig;
22
- /**
23
- * 控制多行输入框 reset(`textarea`)。
24
- */
25
- textareaReset?: false | ResetConfig;
26
- /**
27
- * 控制列表 reset(`ul` / `ol`)。
28
- */
29
- listReset?: false | ResetConfig;
30
- /**
31
- * 控制链接 reset(`navigator` / `a`)。
32
- */
33
- navigatorReset?: false | ResetConfig;
34
- /**
35
- * 控制 `video` reset。
36
- */
37
- videoReset?: false | ResetConfig;
38
- /**
39
- * 额外的 reset 规则,可根据业务自定义。
40
- */
41
- extraResets?: ResetConfig[];
5
+ /**
6
+ * 启用一组内置 reset 预设;默认不传时保持最小行为,仅注入 button/image。
7
+ */
8
+ preset?: ResetPreset | ResetPreset[];
9
+ /**
10
+ * 控制 `button` reset 的注入与选择器,传入 `false` 可跳过该规则。
11
+ */
12
+ buttonReset?: false | ResetConfig;
13
+ /**
14
+ * 控制 `image` reset(同时覆盖 `<image>` 与 `<img>`)。
15
+ */
16
+ imageReset?: false | ResetConfig;
17
+ /**
18
+ * 控制常见输入框 reset(`input`)。
19
+ */
20
+ inputReset?: false | ResetConfig;
21
+ /**
22
+ * 控制多行输入框 reset(`textarea`)。
23
+ */
24
+ textareaReset?: false | ResetConfig;
25
+ /**
26
+ * 控制列表 reset(`ul` / `ol`)。
27
+ */
28
+ listReset?: false | ResetConfig;
29
+ /**
30
+ * 控制链接 reset(`navigator` / `a`)。
31
+ */
32
+ navigatorReset?: false | ResetConfig;
33
+ /**
34
+ * 控制 `video` reset。
35
+ */
36
+ videoReset?: false | ResetConfig;
37
+ /**
38
+ * 额外的 reset 规则,可根据业务自定义。
39
+ */
40
+ extraResets?: ResetConfig[];
42
41
  }
43
42
  interface ResetConfig {
44
- selectors?: string[];
45
- declarations?: Record<string, string | number | false | null | undefined>;
46
- pseudo?: Record<string, string | number | false | null | undefined>;
43
+ selectors?: string[];
44
+ declarations?: Record<string, string | number | false | null | undefined>;
45
+ pseudo?: Record<string, string | number | false | null | undefined>;
47
46
  }
48
-
49
- declare const reset: node_modules_tailwindcss_dist_types_CJYAW1ql_mjs.c<ResetOptions>;
50
-
51
- // @ts-ignore
52
- export = reset;
53
- export { type BuiltInResetName, type ResetConfig, type ResetOptions, type ResetPreset, reset };
47
+ //#endregion
48
+ //#region src/index.d.ts
49
+ interface ResetPluginResult {
50
+ handler: (api: {
51
+ addBase: (base: Record<string, Record<string, string>>) => void;
52
+ }) => void;
53
+ config?: Record<string, unknown>;
54
+ }
55
+ interface ResetPlugin {
56
+ (options?: ResetOptions): ResetPluginResult;
57
+ __isOptionsFunction: true;
58
+ }
59
+ declare const reset: ResetPlugin;
60
+ //#endregion
61
+ export { type BuiltInResetName, type ResetConfig, type ResetOptions, ResetPlugin, ResetPluginResult, type ResetPreset, reset as default, reset };
package/dist/index.mjs CHANGED
@@ -1,276 +1,240 @@
1
- // src/index.ts
2
1
  import plugin from "tailwindcss/plugin";
3
-
4
- // src/normalize.ts
2
+ //#region src/normalize.ts
5
3
  function normalizeResetSelectors(option, defaults) {
6
- const resolved = option?.selectors?.length ? option.selectors : defaults;
7
- const normalized = [];
8
- for (const selector of resolved) {
9
- const trimmed = selector.trim();
10
- if (!trimmed || normalized.includes(trimmed)) {
11
- continue;
12
- }
13
- normalized.push(trimmed);
14
- }
15
- return normalized.length ? normalized : void 0;
4
+ const resolved = option?.selectors?.length ? option.selectors : defaults;
5
+ const normalized = [];
6
+ for (const selector of resolved) {
7
+ const trimmed = selector.trim();
8
+ if (!trimmed || normalized.includes(trimmed)) continue;
9
+ normalized.push(trimmed);
10
+ }
11
+ return normalized.length ? normalized : void 0;
16
12
  }
17
13
  function convertSelectorForBase(selector) {
18
- if (selector.startsWith(".")) {
19
- const className = selector.slice(1);
20
- if (className.length > 0) {
21
- return `[class~="${className}"]`;
22
- }
23
- }
24
- if (selector.startsWith("#")) {
25
- const id = selector.slice(1);
26
- if (id.length > 0) {
27
- return `[id="${id}"]`;
28
- }
29
- }
30
- return selector;
14
+ if (selector.startsWith(".")) {
15
+ const className = selector.slice(1);
16
+ if (className.length > 0) return `[class~="${className}"]`;
17
+ }
18
+ if (selector.startsWith("#")) {
19
+ const id = selector.slice(1);
20
+ if (id.length > 0) return `[id="${id}"]`;
21
+ }
22
+ return selector;
31
23
  }
32
24
  function normalizeDeclarationValue(value) {
33
- if (value === false || value === null || value === void 0) {
34
- return void 0;
35
- }
36
- return typeof value === "number" ? value.toString() : value;
25
+ if (value === false || value === null || value === void 0) return;
26
+ return typeof value === "number" ? value.toString() : value;
37
27
  }
38
28
  function normalizeDeclarations(option, defaults) {
39
- const normalized = { ...defaults };
40
- const overrides = option?.declarations;
41
- if (!overrides) {
42
- return normalized;
43
- }
44
- const entries = Object.entries(overrides);
45
- for (const [prop, value] of entries) {
46
- const resolved = normalizeDeclarationValue(value);
47
- if (resolved === void 0) {
48
- delete normalized[prop];
49
- } else {
50
- normalized[prop] = resolved;
51
- }
52
- }
53
- return normalized;
29
+ const normalized = { ...defaults };
30
+ const overrides = option?.declarations;
31
+ if (!overrides) return normalized;
32
+ const entries = Object.entries(overrides);
33
+ for (const [prop, value] of entries) {
34
+ const resolved = normalizeDeclarationValue(value);
35
+ if (resolved === void 0) delete normalized[prop];
36
+ else normalized[prop] = resolved;
37
+ }
38
+ return normalized;
54
39
  }
55
40
  function normalizePseudo(option, defaults) {
56
- const normalized = defaults ? { ...defaults } : {};
57
- const overrides = option?.pseudo;
58
- if (!overrides) {
59
- return Object.keys(normalized).length ? normalized : void 0;
60
- }
61
- const entries = Object.entries(overrides);
62
- for (const [prop, value] of entries) {
63
- const resolved = normalizeDeclarationValue(value);
64
- if (resolved === void 0) {
65
- delete normalized[prop];
66
- } else {
67
- normalized[prop] = resolved;
68
- }
69
- }
70
- return Object.keys(normalized).length ? normalized : void 0;
41
+ const normalized = defaults ? { ...defaults } : {};
42
+ const overrides = option?.pseudo;
43
+ if (!overrides) return Object.keys(normalized).length ? normalized : void 0;
44
+ const entries = Object.entries(overrides);
45
+ for (const [prop, value] of entries) {
46
+ const resolved = normalizeDeclarationValue(value);
47
+ if (resolved === void 0) delete normalized[prop];
48
+ else normalized[prop] = resolved;
49
+ }
50
+ return Object.keys(normalized).length ? normalized : void 0;
71
51
  }
72
52
  function createResetRule(option, defaults) {
73
- if (option === false) {
74
- return void 0;
75
- }
76
- const selectors = normalizeResetSelectors(option, defaults.selectors);
77
- if (!selectors) {
78
- return void 0;
79
- }
80
- const declarations = normalizeDeclarations(option ?? {}, defaults.declarations);
81
- if (Object.keys(declarations).length === 0) {
82
- return void 0;
83
- }
84
- const pseudo = normalizePseudo(option ?? {}, defaults.pseudo);
85
- return {
86
- selectors: selectors.map(convertSelectorForBase),
87
- declarations,
88
- pseudo
89
- };
53
+ if (option === false) return;
54
+ const selectors = normalizeResetSelectors(option, defaults.selectors);
55
+ if (!selectors) return;
56
+ const declarations = normalizeDeclarations(option ?? {}, defaults.declarations);
57
+ if (Object.keys(declarations).length === 0) return;
58
+ const pseudo = normalizePseudo(option ?? {}, defaults.pseudo);
59
+ return {
60
+ selectors: selectors.map(convertSelectorForBase),
61
+ declarations,
62
+ pseudo
63
+ };
90
64
  }
91
-
92
- // src/index.ts
93
- var DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
94
- var DEFAULT_BUTTON_DECLARATIONS = {
95
- padding: "0",
96
- backgroundColor: "transparent",
97
- fontSize: "inherit",
98
- lineHeight: "inherit",
99
- color: "inherit",
100
- borderWidth: "0"
65
+ //#endregion
66
+ //#region src/index.ts
67
+ const DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
68
+ const DEFAULT_BUTTON_DECLARATIONS = {
69
+ padding: "0",
70
+ backgroundColor: "transparent",
71
+ fontSize: "inherit",
72
+ lineHeight: "inherit",
73
+ color: "inherit",
74
+ borderWidth: "0"
101
75
  };
102
- var BUTTON_RESET_PSEUDO_DECLARATIONS = {
103
- border: "none"
76
+ const BUTTON_RESET_PSEUDO_DECLARATIONS = { border: "none" };
77
+ const DEFAULT_IMAGE_RESET_SELECTORS = ["image", "img"];
78
+ const DEFAULT_IMAGE_DECLARATIONS = {
79
+ display: "block",
80
+ borderWidth: "0",
81
+ backgroundColor: "transparent",
82
+ maxWidth: "100%",
83
+ height: "auto"
104
84
  };
105
- var DEFAULT_IMAGE_RESET_SELECTORS = ["image", "img"];
106
- var DEFAULT_IMAGE_DECLARATIONS = {
107
- display: "block",
108
- borderWidth: "0",
109
- backgroundColor: "transparent",
110
- maxWidth: "100%",
111
- height: "auto"
85
+ const DEFAULT_INPUT_RESET_SELECTORS = ["input"];
86
+ const DEFAULT_INPUT_DECLARATIONS = {
87
+ padding: "0",
88
+ fontSize: "100%",
89
+ fontFamily: "inherit",
90
+ lineHeight: "inherit",
91
+ color: "inherit",
92
+ backgroundColor: "transparent",
93
+ borderWidth: "0"
112
94
  };
113
- var DEFAULT_INPUT_RESET_SELECTORS = ["input"];
114
- var DEFAULT_INPUT_DECLARATIONS = {
115
- padding: "0",
116
- fontSize: "100%",
117
- fontFamily: "inherit",
118
- lineHeight: "inherit",
119
- color: "inherit",
120
- backgroundColor: "transparent",
121
- borderWidth: "0"
95
+ const DEFAULT_TEXTAREA_RESET_SELECTORS = ["textarea"];
96
+ const DEFAULT_TEXTAREA_DECLARATIONS = {
97
+ padding: "0",
98
+ fontSize: "100%",
99
+ fontFamily: "inherit",
100
+ lineHeight: "inherit",
101
+ color: "inherit",
102
+ backgroundColor: "transparent",
103
+ borderWidth: "0",
104
+ resize: "vertical"
122
105
  };
123
- var DEFAULT_TEXTAREA_RESET_SELECTORS = ["textarea"];
124
- var DEFAULT_TEXTAREA_DECLARATIONS = {
125
- padding: "0",
126
- fontSize: "100%",
127
- fontFamily: "inherit",
128
- lineHeight: "inherit",
129
- color: "inherit",
130
- backgroundColor: "transparent",
131
- borderWidth: "0",
132
- resize: "vertical"
106
+ const DEFAULT_LIST_RESET_SELECTORS = ["ul", "ol"];
107
+ const DEFAULT_LIST_DECLARATIONS = {
108
+ listStyle: "none",
109
+ margin: "0",
110
+ padding: "0"
133
111
  };
134
- var DEFAULT_LIST_RESET_SELECTORS = ["ul", "ol"];
135
- var DEFAULT_LIST_DECLARATIONS = {
136
- listStyle: "none",
137
- margin: "0",
138
- padding: "0"
112
+ const DEFAULT_NAVIGATOR_RESET_SELECTORS = ["navigator", "a"];
113
+ const DEFAULT_NAVIGATOR_DECLARATIONS = {
114
+ color: "inherit",
115
+ textDecoration: "inherit"
139
116
  };
140
- var DEFAULT_NAVIGATOR_RESET_SELECTORS = ["navigator", "a"];
141
- var DEFAULT_NAVIGATOR_DECLARATIONS = {
142
- color: "inherit",
143
- textDecoration: "inherit"
117
+ const DEFAULT_VIDEO_RESET_SELECTORS = ["video"];
118
+ const DEFAULT_VIDEO_DECLARATIONS = {
119
+ display: "block",
120
+ maxWidth: "100%",
121
+ height: "auto"
144
122
  };
145
- var DEFAULT_VIDEO_RESET_SELECTORS = ["video"];
146
- var DEFAULT_VIDEO_DECLARATIONS = {
147
- display: "block",
148
- maxWidth: "100%",
149
- height: "auto"
123
+ const presetMap = {
124
+ minimal: ["buttonReset", "imageReset"],
125
+ form: [
126
+ "buttonReset",
127
+ "imageReset",
128
+ "inputReset",
129
+ "textareaReset"
130
+ ],
131
+ content: [
132
+ "buttonReset",
133
+ "imageReset",
134
+ "listReset",
135
+ "navigatorReset"
136
+ ],
137
+ media: [
138
+ "buttonReset",
139
+ "imageReset",
140
+ "videoReset"
141
+ ],
142
+ all: [
143
+ "buttonReset",
144
+ "imageReset",
145
+ "inputReset",
146
+ "textareaReset",
147
+ "listReset",
148
+ "navigatorReset",
149
+ "videoReset"
150
+ ]
150
151
  };
151
- var presetMap = {
152
- minimal: ["buttonReset", "imageReset"],
153
- form: ["buttonReset", "imageReset", "inputReset", "textareaReset"],
154
- content: ["buttonReset", "imageReset", "listReset", "navigatorReset"],
155
- media: ["buttonReset", "imageReset", "videoReset"],
156
- all: [
157
- "buttonReset",
158
- "imageReset",
159
- "inputReset",
160
- "textareaReset",
161
- "listReset",
162
- "navigatorReset",
163
- "videoReset"
164
- ]
165
- };
166
- var builtInResetKeys = [
167
- "buttonReset",
168
- "imageReset",
169
- "inputReset",
170
- "textareaReset",
171
- "listReset",
172
- "navigatorReset",
173
- "videoReset"
152
+ const builtInResetKeys = [
153
+ "buttonReset",
154
+ "imageReset",
155
+ "inputReset",
156
+ "textareaReset",
157
+ "listReset",
158
+ "navigatorReset",
159
+ "videoReset"
174
160
  ];
175
161
  function hasCustomResetConfig(value) {
176
- return value !== void 0 && value !== false;
162
+ return value !== void 0 && value !== false;
177
163
  }
178
164
  function resolvePresetFlags(options) {
179
- const resolved = {
180
- buttonReset: true,
181
- imageReset: true,
182
- inputReset: false,
183
- textareaReset: false,
184
- listReset: false,
185
- navigatorReset: false,
186
- videoReset: false
187
- };
188
- const presets = options?.preset;
189
- if (presets) {
190
- const normalizedPresets = Array.isArray(presets) ? presets : [presets];
191
- for (const preset of normalizedPresets) {
192
- for (const key of presetMap[preset]) {
193
- resolved[key] = true;
194
- }
195
- }
196
- }
197
- for (const key of builtInResetKeys) {
198
- if (hasCustomResetConfig(options?.[key])) {
199
- resolved[key] = true;
200
- }
201
- }
202
- return resolved;
165
+ const resolved = {
166
+ buttonReset: true,
167
+ imageReset: true,
168
+ inputReset: false,
169
+ textareaReset: false,
170
+ listReset: false,
171
+ navigatorReset: false,
172
+ videoReset: false
173
+ };
174
+ const presets = options?.preset;
175
+ if (presets) {
176
+ const normalizedPresets = Array.isArray(presets) ? presets : [presets];
177
+ for (const preset of normalizedPresets) for (const key of presetMap[preset]) resolved[key] = true;
178
+ }
179
+ for (const key of builtInResetKeys) if (hasCustomResetConfig(options?.[key])) resolved[key] = true;
180
+ return resolved;
203
181
  }
204
- var reset = plugin.withOptions(
205
- (options) => {
206
- const rules = [];
207
- const enabledFlags = resolvePresetFlags(options);
208
- const builtInRules = [
209
- enabledFlags.buttonReset ? createResetRule(options?.buttonReset, {
210
- selectors: DEFAULT_BUTTON_RESET_SELECTORS,
211
- declarations: DEFAULT_BUTTON_DECLARATIONS,
212
- pseudo: BUTTON_RESET_PSEUDO_DECLARATIONS
213
- }) : void 0,
214
- enabledFlags.imageReset ? createResetRule(options?.imageReset, {
215
- selectors: DEFAULT_IMAGE_RESET_SELECTORS,
216
- declarations: DEFAULT_IMAGE_DECLARATIONS
217
- }) : void 0,
218
- enabledFlags.inputReset ? createResetRule(options?.inputReset, {
219
- selectors: DEFAULT_INPUT_RESET_SELECTORS,
220
- declarations: DEFAULT_INPUT_DECLARATIONS
221
- }) : void 0,
222
- enabledFlags.textareaReset ? createResetRule(options?.textareaReset, {
223
- selectors: DEFAULT_TEXTAREA_RESET_SELECTORS,
224
- declarations: DEFAULT_TEXTAREA_DECLARATIONS
225
- }) : void 0,
226
- enabledFlags.listReset ? createResetRule(options?.listReset, {
227
- selectors: DEFAULT_LIST_RESET_SELECTORS,
228
- declarations: DEFAULT_LIST_DECLARATIONS
229
- }) : void 0,
230
- enabledFlags.navigatorReset ? createResetRule(options?.navigatorReset, {
231
- selectors: DEFAULT_NAVIGATOR_RESET_SELECTORS,
232
- declarations: DEFAULT_NAVIGATOR_DECLARATIONS
233
- }) : void 0,
234
- enabledFlags.videoReset ? createResetRule(options?.videoReset, {
235
- selectors: DEFAULT_VIDEO_RESET_SELECTORS,
236
- declarations: DEFAULT_VIDEO_DECLARATIONS
237
- }) : void 0
238
- ];
239
- for (const rule of builtInRules) {
240
- if (rule) {
241
- rules.push(rule);
242
- }
243
- }
244
- for (const extra of options?.extraResets ?? []) {
245
- const normalized = createResetRule(extra, {
246
- selectors: extra.selectors ?? [],
247
- declarations: {}
248
- });
249
- if (normalized) {
250
- rules.push(normalized);
251
- }
252
- }
253
- return ({ addBase }) => {
254
- if (!rules.length) {
255
- return;
256
- }
257
- const baseRules = {};
258
- for (const rule of rules) {
259
- baseRules[rule.selectors.join(",")] = rule.declarations;
260
- if (rule.pseudo) {
261
- const pseudoSelectors = rule.selectors.map((selector) => `${selector}::after`).join(",");
262
- baseRules[pseudoSelectors] = rule.pseudo;
263
- }
264
- }
265
- addBase(baseRules);
266
- };
267
- },
268
- () => {
269
- return {};
270
- }
271
- );
272
- var index_default = reset;
273
- export {
274
- index_default as default,
275
- reset
276
- };
182
+ const reset = plugin.withOptions((options) => {
183
+ const rules = [];
184
+ const enabledFlags = resolvePresetFlags(options);
185
+ const builtInRules = [
186
+ enabledFlags.buttonReset ? createResetRule(options?.buttonReset, {
187
+ selectors: DEFAULT_BUTTON_RESET_SELECTORS,
188
+ declarations: DEFAULT_BUTTON_DECLARATIONS,
189
+ pseudo: BUTTON_RESET_PSEUDO_DECLARATIONS
190
+ }) : void 0,
191
+ enabledFlags.imageReset ? createResetRule(options?.imageReset, {
192
+ selectors: DEFAULT_IMAGE_RESET_SELECTORS,
193
+ declarations: DEFAULT_IMAGE_DECLARATIONS
194
+ }) : void 0,
195
+ enabledFlags.inputReset ? createResetRule(options?.inputReset, {
196
+ selectors: DEFAULT_INPUT_RESET_SELECTORS,
197
+ declarations: DEFAULT_INPUT_DECLARATIONS
198
+ }) : void 0,
199
+ enabledFlags.textareaReset ? createResetRule(options?.textareaReset, {
200
+ selectors: DEFAULT_TEXTAREA_RESET_SELECTORS,
201
+ declarations: DEFAULT_TEXTAREA_DECLARATIONS
202
+ }) : void 0,
203
+ enabledFlags.listReset ? createResetRule(options?.listReset, {
204
+ selectors: DEFAULT_LIST_RESET_SELECTORS,
205
+ declarations: DEFAULT_LIST_DECLARATIONS
206
+ }) : void 0,
207
+ enabledFlags.navigatorReset ? createResetRule(options?.navigatorReset, {
208
+ selectors: DEFAULT_NAVIGATOR_RESET_SELECTORS,
209
+ declarations: DEFAULT_NAVIGATOR_DECLARATIONS
210
+ }) : void 0,
211
+ enabledFlags.videoReset ? createResetRule(options?.videoReset, {
212
+ selectors: DEFAULT_VIDEO_RESET_SELECTORS,
213
+ declarations: DEFAULT_VIDEO_DECLARATIONS
214
+ }) : void 0
215
+ ];
216
+ for (const rule of builtInRules) if (rule) rules.push(rule);
217
+ for (const extra of options?.extraResets ?? []) {
218
+ const normalized = createResetRule(extra, {
219
+ selectors: extra.selectors ?? [],
220
+ declarations: {}
221
+ });
222
+ if (normalized) rules.push(normalized);
223
+ }
224
+ return ({ addBase }) => {
225
+ if (!rules.length) return;
226
+ const baseRules = {};
227
+ for (const rule of rules) {
228
+ baseRules[rule.selectors.join(",")] = rule.declarations;
229
+ if (rule.pseudo) {
230
+ const pseudoSelectors = rule.selectors.map((selector) => `${selector}::after`).join(",");
231
+ baseRules[pseudoSelectors] = rule.pseudo;
232
+ }
233
+ }
234
+ addBase(baseRules);
235
+ };
236
+ }, () => {
237
+ return {};
238
+ });
239
+ //#endregion
240
+ export { reset as default, reset };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/reset",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-next.1",
4
4
  "description": "weapp-tailwindcss 的静态 reset 样式资源集合",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -42,20 +42,20 @@
42
42
  "uni-app"
43
43
  ],
44
44
  "engines": {
45
- "node": ">=20.19.0"
45
+ "node": "^20.19.0 || >=22.12.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "tailwindcss": "^3.0.0 || ^4.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@weapp-tailwindcss/test-helper": "0.0.1"
51
+ "@weapp-tailwindcss/test-helper": "0.0.2-next.1"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public",
55
55
  "registry": "https://registry.npmjs.org"
56
56
  },
57
57
  "scripts": {
58
- "build": "tsup",
58
+ "build": "tsdown",
59
59
  "test": "vitest run",
60
60
  "test:dev": "vitest"
61
61
  }
package/dist/index.d.mts DELETED
@@ -1,51 +0,0 @@
1
- import * as node_modules_tailwindcss_dist_types_CJYAW1ql_mjs from 'node_modules/tailwindcss/dist/types-CJYAW1ql.mjs';
2
-
3
- type ResetPreset = 'minimal' | 'form' | 'content' | 'media' | 'all';
4
- type BuiltInResetName = 'buttonReset' | 'imageReset' | 'inputReset' | 'textareaReset' | 'listReset' | 'navigatorReset' | 'videoReset';
5
- interface ResetOptions {
6
- /**
7
- * 启用一组内置 reset 预设;默认不传时保持最小行为,仅注入 button/image。
8
- */
9
- preset?: ResetPreset | ResetPreset[];
10
- /**
11
- * 控制 `button` reset 的注入与选择器,传入 `false` 可跳过该规则。
12
- */
13
- buttonReset?: false | ResetConfig;
14
- /**
15
- * 控制 `image` reset(同时覆盖 `<image>` 与 `<img>`)。
16
- */
17
- imageReset?: false | ResetConfig;
18
- /**
19
- * 控制常见输入框 reset(`input`)。
20
- */
21
- inputReset?: false | ResetConfig;
22
- /**
23
- * 控制多行输入框 reset(`textarea`)。
24
- */
25
- textareaReset?: false | ResetConfig;
26
- /**
27
- * 控制列表 reset(`ul` / `ol`)。
28
- */
29
- listReset?: false | ResetConfig;
30
- /**
31
- * 控制链接 reset(`navigator` / `a`)。
32
- */
33
- navigatorReset?: false | ResetConfig;
34
- /**
35
- * 控制 `video` reset。
36
- */
37
- videoReset?: false | ResetConfig;
38
- /**
39
- * 额外的 reset 规则,可根据业务自定义。
40
- */
41
- extraResets?: ResetConfig[];
42
- }
43
- interface ResetConfig {
44
- selectors?: string[];
45
- declarations?: Record<string, string | number | false | null | undefined>;
46
- pseudo?: Record<string, string | number | false | null | undefined>;
47
- }
48
-
49
- declare const reset: node_modules_tailwindcss_dist_types_CJYAW1ql_mjs.c<ResetOptions>;
50
-
51
- export { type BuiltInResetName, type ResetConfig, type ResetOptions, type ResetPreset, reset as default, reset };