@empjs/plugin-lightningcss 3.0.0-rc.11 → 3.0.0-rc.12
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 +2 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,40 +5,5 @@
|
|
|
5
5
|
pnpm add @empjs/plugin-lightningcss -D
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
import {defineConfig} from '@empjs/cli'
|
|
11
|
-
import pluginLightningcss, {postcss} from '@empjs/plugin-lightningcss'
|
|
12
|
-
const transformUnitFomat = 'vw'
|
|
13
|
-
export default defineConfig(store => {
|
|
14
|
-
const visitor = transformUnitFomat==='rem' ? postcss.px_to_rem() : postcss.px_to_viewport({})
|
|
15
|
-
return {
|
|
16
|
-
plugins:[
|
|
17
|
-
pluginLightningcss({
|
|
18
|
-
transform: {
|
|
19
|
-
visitor,
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
],
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## 增加变量
|
|
29
|
-
+ excludeSelectors 屏蔽选择器,如`[{type: 'class', name: 'cssModule'}]`
|
|
30
|
-
+ excludeUnit 防止转换`px`的写法,默认为 `ipx`;
|
|
31
|
-
+ (*) 加上横杠会出现不可预知问题 如 marign 1-px solid #222 会多出一个空格
|
|
32
|
-
+ `--px` 会解析成变量来处理,不会做 ignore 操作
|
|
33
|
-
```js
|
|
34
|
-
/**
|
|
35
|
-
* 屏蔽选择器 [{type: 'class', name: 'cssModule'}]
|
|
36
|
-
* @default []
|
|
37
|
-
*/
|
|
38
|
-
excludeSelectors: ExcludeSelectorsType[]
|
|
39
|
-
/**
|
|
40
|
-
* 屏蔽单位 大小写无法区分 只支持 -px 等横杠
|
|
41
|
-
* @default -px
|
|
42
|
-
*/
|
|
43
|
-
excludeUnit: string
|
|
44
|
-
```
|
|
8
|
+
## 使用
|
|
9
|
+
[使用详情](https://empjs.dev/plugin/tool/lightningcss.html)
|