Files
element-plus/packages/theme-chalk/src/col.scss
jeremywu a16201e5ba fix(col): fix/col-style-gets-affected-by-invalid-value (#1370)
* fix(col): fix/col-style-gets-affected-by-invalid-value

- Fix the 0 value that impacts the layout rule. Fix #1366

* remove !important syntax

* fix lint issue
2021-01-27 20:10:59 +08:00

186 lines
3.4 KiB
SCSS

@import './common/var.scss';
@import './mixins/mixins.scss';
[class*='el-col-'] {
float: left;
box-sizing: border-box;
@include when(guttered) {
display: block;
min-height: 1px;
}
}
.el-col-0 {
display: none;
// to avoid introducing !important syntax, redundant css rule is required due to selector priority.
@include when(guttered) {
display: none;
}
}
@for $i from 0 through 24 {
.el-col-#{$i} {
max-width: (1 / 24 * $i * 100) * 1%;
flex: 0 0 (1 / 24 * $i * 100) * 1%;
}
.el-col-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
}
.el-col-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
}
.el-col-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
}
}
@include res(xs) {
.el-col-xs-0 {
display: none;
@include when(guttered) {
display: none;
}
}
@for $i from 0 through 24 {
.el-col-xs-#{$i} {
max-width: (1 / 24 * $i * 100) * 1%;
flex: 0 0 (1 / 24 * $i * 100) * 1%;
}
.el-col-xs-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
}
.el-col-xs-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
}
.el-col-xs-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
}
}
}
@include res(sm) {
.el-col-sm-0 {
display: none;
@include when(guttered) {
display: none;
}
}
@for $i from 0 through 24 {
.el-col-sm-#{$i} {
max-width: (1 / 24 * $i * 100) * 1%;
flex: 0 0 (1 / 24 * $i * 100) * 1%;
}
.el-col-sm-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
}
.el-col-sm-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
}
.el-col-sm-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
}
}
}
@include res(md) {
.el-col-md-0 {
display: none;
@include when(guttered) {
display: none;
}
}
@for $i from 0 through 24 {
.el-col-md-#{$i} {
max-width: (1 / 24 * $i * 100) * 1%;
flex: 0 0 (1 / 24 * $i * 100) * 1%;
}
.el-col-md-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
}
.el-col-md-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
}
.el-col-md-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
}
}
}
@include res(lg) {
.el-col-lg-0 {
display: none;
@include when(guttered) {
display: none;
}
}
@for $i from 0 through 24 {
.el-col-lg-#{$i} {
max-width: (1 / 24 * $i * 100) * 1%;
flex: 0 0 (1 / 24 * $i * 100) * 1%;
}
.el-col-lg-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
}
.el-col-lg-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
}
.el-col-lg-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
}
}
}
@include res(xl) {
.el-col-xl-0 {
display: none;
@include when(guttered) {
display: none;
}
}
@for $i from 0 through 24 {
.el-col-xl-#{$i} {
max-width: (1 / 24 * $i * 100) * 1%;
flex: 0 0 (1 / 24 * $i * 100) * 1%;
}
.el-col-xl-offset-#{$i} {
margin-left: (1 / 24 * $i * 100) * 1%;
}
.el-col-xl-pull-#{$i} {
position: relative;
right: (1 / 24 * $i * 100) * 1%;
}
.el-col-xl-push-#{$i} {
position: relative;
left: (1 / 24 * $i * 100) * 1%;
}
}
}