Skip to content

Commit

Permalink
修复grid的scss,计算兼容性问题
Browse files Browse the repository at this point in the history
  • Loading branch information
iZaiZaiA committed Jan 22, 2022
1 parent b103f55 commit 1398df5
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions mp-cu/colorUI/scss/style/_grid.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/* ==================
栅栏
==================== */

@mixin make_col($screen) {
@for $i from 1 through 12 {
.ui-col-#{$screen}-#{$i} {
width: #{100% / 12 * $i};
}
.ui-cols-#{$screen}-#{$i} .ui-item {
width: #{100% / $i};
}
}
}

.ui-container {
box-sizing: border-box;
margin-left: auto;
Expand Down Expand Up @@ -50,8 +40,8 @@
@for $i from 1 through 12 {
&.ui-cols-#{$i} > .ui-item {
padding-bottom: calc((100% - #{20rpx * ($i - 1)}) / #{$i});
height: 0;
width: calc((100% - #{20rpx * ($i - 1)}) / #{$i});
height: 0;
}
}
@for $i from 1 through 12 {
Expand All @@ -63,19 +53,31 @@
}
@for $i from 1 through 12 {
.ui-cols-#{$i} .ui-item {
width: #{100% / $i};
width: calc(100% / #{$i});
}
}
@for $i from 1 through 12 {
.ui-col-#{$i} {
width: #{100% / 12 * $i};
width: calc(100% / 12 * #{$i});
}
}
@for $i from 1 through 24 {
.ui-col-lg-#{$i} {
width: calc(100% / 24 * #{$i});
}
}

@mixin make_col($screen) {
@for $i from 1 through 12 {
.ui-col-#{$screen}-#{$i} {
width: calc(100% / 12 * #{$i});
}
.ui-cols-#{$screen}-#{$i} .ui-item {
width: calc(100% / #{$i});
}
}
}

// 小屏
@media screen and (min-width: 0px) {
@include make_col('xs');
Expand Down Expand Up @@ -105,6 +107,11 @@
@media screen and (min-width: 1920px) {
@include make_col('xxl');
}





ui-col {
display: contents;
}

0 comments on commit 1398df5

Please sign in to comment.