File tree Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 1212 * #responsive 响应式
1313 */
1414
15+ @use " sass:math" ;
16+
1517// #common 通用部分
1618
1719// 通用栏目
3234 transform : scaleY (.5 );
3335 }
3436 @include screenResolution (3 ) {
35- transform : scaleY (( 1 / 3 ));
37+ transform : scaleY (math . div ( 1 , 3 ));
3638 }
3739 }
3840
349351 .index_appIntro_img {
350352 height : auto ;
351353 width : $index_appIntro_img_mobile_width ;
352- padding-bottom : $index_appIntro_img_height / $index_appIntro_img_width * $index_appIntro_img_mobile_width ;
354+ padding-bottom : math . div ( $index_appIntro_img_height , $index_appIntro_img_width ) * $index_appIntro_img_mobile_width ;
353355 }
354356 .index_appIntro_desc {
355357 margin-bottom : 30px ;
Original file line number Diff line number Diff line change 66 *
77 */
88
9+ @use " sass:math" ;
10+
911// 业务公共变量
1012@import " _var" ;
1113
5254 transform : scaleY (.5 );
5355 }
5456 @include screenResolution (3 ) {
55- transform : scaleY (( 1 / 3 ));
57+ transform : scaleY (math . div ( 1 , 3 ));
5658 }
5759 }
5860
Original file line number Diff line number Diff line change 11@charset " utf-8" ;
22
3+ @use " sass:math" ;
4+
35/// /
46/// 辅助数值计算的工具方法
57/// @author Kayo
9193/// @param {Number | String} $parent - 较大的长度值
9294/// @param {Number | String} $child - 较小的长度值
9395@function getLengthMaxIntegerCenter ($parent , $child ) {
94- $center : ($parent - $child ) / 2 ;
96+ $center : math . div ($parent - $child , 2 ) ;
9597 // 注意这里的取整使用 ceil 而不是 floor 并不是随意写的,这是模拟现代浏览器对于小数点长度值的表现而定的。
9698 // 例如,margin-top: 10.5px 在现代浏览器中会表现为 margin-top: 11px 而不是 margin-top: 10px
9799 // 又例如,margin-top: -10.5px 在现代浏览器的表现等同于 margin-top: -10px 而不是 margin-top: -11px
130132@function sqrt ($num ) {
131133 $temp :1 ;
132134 @while abs ($temp - $num / $temp ) > 1e-6 {
133- $temp : ($temp + $num / $temp ) / 2 ;
135+ $temp : ($temp + $num / $temp ) / 2 ;
134136 }
135137 @return $temp ;
136138}
Original file line number Diff line number Diff line change 11@charset " utf-8" ;
22
3+ @use " sass:math" ;
4+
35/// /
46/// 辅助编写样式效果的工具方法
57/// @author Kayo
2527 position : absolute ;
2628 left : 50% ;
2729 top : 50% ;
28- margin : (- $height ) / 2 0 0 (- $width ) / 2 ;
30+ margin : math . div (- $height , 2 ) 0 0 math . div (- $width , 2 ) ;
2931}
3032
3133%triangleCommonStyle {
5052 @extend %triangleCommonStyle ;
5153 /* 向上小三角 */
5254 @if $direction == top {
53- border-width : $height $width / 2 ;
55+ border-width : $height math . div ( $width , 2 ) ;
5456 border-top : 0 ;
5557 border-bottom-color : $borderColor ;
5658 }
5759 /* 向下小三角 */
5860 @else if $direction == bottom {
59- border-width : $height $width / 2 ;
61+ border-width : $height math . div ( $width , 2 ) ;
6062 border-bottom : 0 ;
6163 border-top-color : $borderColor ;
6264 }
6365 /* 向左小三角 */
6466 @else if $direction == left {
65- border-width : $width / 2 $height ;
67+ border-width : math . div ( $width , 2 ) $height ;
6668 border-left : 0 ;
6769 border-right-color : $borderColor ;
6870 }
6971 /* 向右小三角 */
7072 @else if $direction == right {
71- border-width : $width / 2 $height ;
73+ border-width : math . div ( $width , 2 ) $height ;
7274 border-right : 0 ;
7375 border-left-color : $borderColor ;
7476 }
183185 }
184186 height : 300% ;
185187 border-radius : $borderRadius * 3 ;
186- transform : scale (( 1 / 3 ));
188+ transform : scale (math . div ( 1 , 3 ));
187189 }
188190 }
189191}
You can’t perform that action at this time.
0 commit comments