Browse Source

✨ feat(styles): 添加响应式单位转换函数pxToVw以支持视口宽度

陈雪 3 weeks ago
parent
commit
efa3280d30
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/assets/main.scss

+ 7 - 0
src/assets/main.scss

@@ -0,0 +1,7 @@
+@use 'sass:math';
+
+$baseWidth: 1920;
+
+@function pxToVw($px) {
+  @return #{math.div($px, $baseWidth) * 100}+ vw;
+}