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.
- package/README.md +28 -7
- package/package.json +1 -1
- package/styimat.js +1436 -1429
- package/styimat.min.js +126 -126
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# styimat
|
|
2
|
-
|
|
3
|
-
[](https://gitee.com/wxy6987/styimat/stargazers)
|
|
4
|
+
[](https://gitee.com/wxy6987/styimat/members)
|
|
5
|
+
[](https://www.npmjs.com/package/styimat)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](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
|
-
|
|
555
|
+
1. **Fork 本仓库**
|
|
556
|
+
[](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
|
-
**如果这个项目对你有帮助,请给个
|
|
581
|
+
**如果这个项目对你有帮助,请给个
|
|
582
|
+
[](https://gitee.com/wxy6987/styimat/stargazers)**
|