@pikacss/plugin-reset 0.0.38 → 0.0.40
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/README.md +51 -16
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable -->
|
|
1
2
|
# @pikacss/plugin-reset
|
|
2
3
|
|
|
3
4
|
CSS reset/normalize plugin for PikaCSS.
|
|
@@ -18,11 +19,11 @@ import { defineEngineConfig } from '@pikacss/core'
|
|
|
18
19
|
import { reset } from '@pikacss/plugin-reset'
|
|
19
20
|
|
|
20
21
|
export default defineEngineConfig({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
plugins: [
|
|
23
|
+
reset()
|
|
24
|
+
],
|
|
25
|
+
// Choose which reset style to use
|
|
26
|
+
reset: 'modern-normalize' // default
|
|
26
27
|
})
|
|
27
28
|
```
|
|
28
29
|
|
|
@@ -57,9 +58,9 @@ import { defineEngineConfig } from '@pikacss/core'
|
|
|
57
58
|
import { reset } from '@pikacss/plugin-reset'
|
|
58
59
|
|
|
59
60
|
export default defineEngineConfig({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
plugins: [
|
|
62
|
+
reset()
|
|
63
|
+
]
|
|
63
64
|
})
|
|
64
65
|
```
|
|
65
66
|
|
|
@@ -74,11 +75,11 @@ import { defineEngineConfig } from '@pikacss/core'
|
|
|
74
75
|
import { reset } from '@pikacss/plugin-reset'
|
|
75
76
|
|
|
76
77
|
export default defineEngineConfig({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
plugins: [
|
|
79
|
+
reset()
|
|
80
|
+
],
|
|
81
|
+
// Options: 'modern-normalize' | 'normalize' | 'andy-bell' | 'eric-meyer' | 'the-new-css-reset'
|
|
82
|
+
reset: 'andy-bell'
|
|
82
83
|
})
|
|
83
84
|
```
|
|
84
85
|
|
|
@@ -96,14 +97,48 @@ The reset style is configured at the engine level:
|
|
|
96
97
|
|
|
97
98
|
```typescript
|
|
98
99
|
export default defineEngineConfig({
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
plugins: [reset()],
|
|
101
|
+
reset: 'modern-normalize' // default
|
|
101
102
|
})
|
|
102
103
|
```
|
|
103
104
|
|
|
105
|
+
## TypeScript Module Augmentation
|
|
106
|
+
|
|
107
|
+
This plugin extends the `EngineConfig` interface from `@pikacss/core` to add the `reset` configuration option. This is done through TypeScript declaration merging:
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// Declared in @pikacss/plugin-reset source
|
|
111
|
+
declare module '@pikacss/core' {
|
|
112
|
+
interface EngineConfig {
|
|
113
|
+
/**
|
|
114
|
+
* Reset style to use.
|
|
115
|
+
*
|
|
116
|
+
* @default 'modern-normalize'
|
|
117
|
+
*/
|
|
118
|
+
reset?: ResetStyle
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
When you import and register the plugin, TypeScript automatically recognizes the `reset` property on your config object, providing autocomplete and type checking:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { defineEngineConfig } from '@pikacss/core'
|
|
127
|
+
import { reset } from '@pikacss/plugin-reset'
|
|
128
|
+
|
|
129
|
+
export default defineEngineConfig({
|
|
130
|
+
plugins: [reset()],
|
|
131
|
+
// TypeScript provides autocomplete for valid reset values
|
|
132
|
+
reset: 'normalize' // ✅ Type-safe: only valid ResetStyle values accepted
|
|
133
|
+
// reset: 'invalid' // ❌ TypeScript error: not assignable to type ResetStyle
|
|
134
|
+
})
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
This module augmentation pattern is used by all official PikaCSS plugins to extend the core configuration interface.
|
|
138
|
+
|
|
104
139
|
## Documentation
|
|
105
140
|
|
|
106
|
-
For complete documentation, visit: [PikaCSS Documentation](https://pikacss.
|
|
141
|
+
For complete documentation, visit: [PikaCSS Documentation](https://pikacss.github.io/pikacss/)
|
|
107
142
|
|
|
108
143
|
## License
|
|
109
144
|
|
package/package.json
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.40",
|
|
8
8
|
"author": "DevilTea <ch19980814@gmail.com>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/pikacss/pikacss.git",
|
|
12
|
+
"url": "https://github.com/pikacss/pikacss.github.io.git",
|
|
13
13
|
"directory": "packages/plugin-reset"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
16
|
-
"url": "https://github.com/pikacss/pikacss/issues"
|
|
16
|
+
"url": "https://github.com/pikacss/pikacss.github.io/issues"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"pikacss",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@pikacss/core": "0.0.
|
|
42
|
+
"@pikacss/core": "0.0.40"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@pikacss/core": "0.0.
|
|
45
|
+
"@pikacss/core": "0.0.40"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsdown",
|