styimat 3.1.2 → 3.2.0

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.
Files changed (2) hide show
  1. package/README.md +12 -0
  2. package/package.json +13 -1
package/README.md CHANGED
@@ -105,6 +105,18 @@ require(['styimat'], function(styimat) {
105
105
  });
106
106
  ```
107
107
 
108
+ ### ESModule使用
109
+ ```javascript
110
+ import styimat from 'https://cdn.jsdelivr.net/npm/styimat/styimat.min.mjs'
111
+ const css = `
112
+ $primary: lab(54.7 77.9 80.1);
113
+ .button { background-color: $primary; }
114
+ `;
115
+
116
+ const result = styimat(css);
117
+ console.log(result);
118
+ ```
119
+
108
120
  ### 命令行使用
109
121
 
110
122
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styimat",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "一个高效的CSS变量预处理库,支持Lab/LCH颜色空间自动转换、嵌套选择器和Display P3广色域,让现代CSS开发更简洁强大。",
5
5
  "keywords": [
6
6
  "css",
@@ -18,6 +18,18 @@
18
18
  "author": "王小玗",
19
19
  "type": "commonjs",
20
20
  "main": "dist/styimat.min.js",
21
+ "exports": {
22
+ ".": {
23
+ "import": "./dist/styimat.min.mjs",
24
+ "require": "./dist/styimat.min.js",
25
+ "default": "./dist/styimat.min.js"
26
+ },
27
+ "./convert": {
28
+ "import": "./bin/convert-styimat.js",
29
+ "require": "./bin/convert-styimat.js",
30
+ "default": "./bin/convert-styimat.js"
31
+ }
32
+ },
21
33
  "browser": "dist/styimat.min.js",
22
34
  "unpkg": "dist/styimat.min.js",
23
35
  "jsdelivr": "dist/styimat.min.js",