@templmf/temp-solf-lmf 0.0.148 → 0.0.149
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/new.txt +21 -0
- package/package.json +1 -1
package/new.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
换算公式:rem值 = px值 / 100
|
|
2
|
+
例如:JSON 中读到某元素 width: 200px → 输出为 width: 2rem
|
|
3
|
+
例如:JSON 中读到 fontSize: 28px → 输出为 font-size: 0.28rem
|
|
4
|
+
|
|
5
|
+
边框(border-width)、1px 分割线等极小数值可以保留 px,
|
|
6
|
+
避免出现小数点过多位的 rem 值影响渲染精度。
|
|
7
|
+
|
|
8
|
+
【SVG 尺寸规则】
|
|
9
|
+
所有内联 SVG 图标不要写死 width/height 属性值(不要用
|
|
10
|
+
get_node_svg 返回的原始像素尺寸直接赋值)。
|
|
11
|
+
SVG 容器尺寸应使用 em 单位或继承父级 font-size,
|
|
12
|
+
使其能随外部 rem 环境自动缩放。
|
|
13
|
+
具体做法:
|
|
14
|
+
- SVG 根标签只保留 viewBox,去掉写死的 width/height,
|
|
15
|
+
或将 width/height 设为 1em
|
|
16
|
+
- 外层包裹容器用 rem 控制实际显示尺寸,如:
|
|
17
|
+
.icon { width: 0.4rem; height: 0.4rem; }
|
|
18
|
+
.icon svg { width: 100%; height: 100%; }
|
|
19
|
+
|
|
20
|
+
请在生成代码后自查:所有尺寸类 CSS 属性是否已按上述比例
|
|
21
|
+
换算为 rem,且没有遗漏 SVG 内部的写死尺寸。
|