styimat 1.5.0 → 1.6.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.
Files changed (4) hide show
  1. package/README.md +28 -7
  2. package/package.json +1 -1
  3. package/styimat.js +1436 -1429
  4. package/styimat.min.js +126 -126
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # styimat
2
- [![Stars](https://gitee.com/wxy6987/styimat/badge/star.svg?theme=white)](https://gitee.com/wxy6987/styimat/stargazers)
3
- [![Forks](https://gitee.com/wxy6987/styimat/badge/fork.svg?theme=white)](https://gitee.com/wxy6987/styimat/members)
2
+
3
+ [![Stars](https://img.shields.io/badge/dynamic/json?label=Stars&query=%24.stargazers_count&url=https%3A%2F%2Fgitee.com%2Fapi%2Fv5%2Frepos%2Fwxy6987%2Fstyimat&color=FFD700&style=yellow)](https://gitee.com/wxy6987/styimat/stargazers)
4
+ [![Forks](https://img.shields.io/badge/dynamic/json?label=Forks&query=%24.forks_count&url=https%3A%2F%2Fgitee.com%2Fapi%2Fv5%2Frepos%2Fwxy6987%2Fstyimat&color=red)](https://gitee.com/wxy6987/styimat/members)
5
+ [![version](https://img.shields.io/npm/v/styimat.svg?color=brightgreen)](https://www.npmjs.com/package/styimat)
6
+ [![license](https://img.shields.io/npm/l/styimat.svg?color=lightgrey)](LICENSE)
7
+ [![size](https://img.shields.io/bundlephobia/minzip/styimat?label=size&color=blue)](https://bundlephobia.com/package/styimat)
8
+
9
+
4
10
 
5
11
  一个功能强大的 CSS 变量预处理库,支持嵌套规则、Lab/LCH 颜色空间转换、Display P3 广色域和增强的数学计算功能。
6
12
 
@@ -213,6 +219,19 @@ const mathResult = styimat.math.evaluate('100px / 2'); // "50px"
213
219
  const rgbColor = styimat.colorUtils.labToRGB(54.7, 77.9, 80.1);
214
220
  ```
215
221
 
222
+ ### 4. HTMLElement的新方法
223
+ HTMLElement由此库新增了`cssVar`属性,可以设置、获取css变量
224
+
225
+ ```javascript
226
+ ele.cssVar(prop, value); // 设置prop变量为value
227
+ ele.cssVar.prop = value; // 设置prop变量为value
228
+ ele.cssVar[prop] = value; // 设置prop变量为value
229
+ ele.cssVar(prop); // 获取prop变量的值
230
+ ele.cssVar.prop; // 获取prop变量的值
231
+ ele.cssVar[prop] // 获取prop变量的值
232
+
233
+ ```
234
+
216
235
  ### 4. 混合使用示例
217
236
 
218
237
  ```javascript
@@ -533,16 +552,17 @@ $primary-transparent: lab(55 190 0 / 0.8);
533
552
 
534
553
  欢迎贡献代码!请遵循以下步骤:
535
554
 
536
- 1. **Fork 本仓库**
537
- 2. **创建特性分支**
555
+ 1. **Fork 本仓库**
556
+ [![Forks](https://img.shields.io/badge/点击即可Forks-click?color=red)](https://gitee.com/wxy6987/styimat/members)
557
+ 2. **创建特性分支**
538
558
  ```bash
539
559
  git checkout -b feature/AmazingFeature
540
560
  ```
541
- 3. **提交更改**
561
+ 3. **提交更改**
542
562
  ```bash
543
563
  git commit -m 'Add some AmazingFeature'
544
564
  ```
545
- 4. **推送到分支**
565
+ 4. **推送到分支**
546
566
  ```bash
547
567
  git push origin feature/AmazingFeature
548
568
  ```
@@ -558,4 +578,5 @@ MIT © 王小玗 2025
558
578
 
559
579
  ---
560
580
 
561
- **如果这个项目对你有帮助,请给个 [![Star](https://gitee.com/wxy6987/styimat/badge/star.svg?theme=white)](https://gitee.com/wxy6987/styimat)**
581
+ **如果这个项目对你有帮助,请给个
582
+ [![Stars](https://img.shields.io/badge/dynamic/json?label=Stars&query=%24.stargazers_count&url=https%3A%2F%2Fgitee.com%2Fapi%2Fv5%2Frepos%2Fwxy6987%2Fstyimat&color=FFD700&style=yellow)](https://gitee.com/wxy6987/styimat/stargazers)**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styimat",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "一个高效的CSS变量预处理库,支持Lab/LCH颜色空间自动转换、嵌套选择器和Display P3广色域,让现代CSS开发更简洁强大。",
5
5
  "keywords": [
6
6
  "css",