less
.flex {
display: flex
}
.flex-x {
flex-direction: row
}
.flex-y {
flex-direction: column
}
.flex-x-start {
justify-content: flex-start
}
.flex-x-center {
justify-content: center
}
.flex-x-end {
justify-content: flex-end
}
.flex-x-between {
justify-content: space-between
}
.flex-x-around {
justify-content: space-around
}
.flex-x-evenly {
justify-content: space-evenly
}
.flex-y-start {
align-items: flex-start
}
.flex-y-center {
align-items: center
}
.flex-y-end {
align-items: flex-end
}
.flex-wrap {
flex-wrap: wrap;
}
.self-start {
align-self: flex-start;
}
.self-center {
align-self: flex-center;
}
.self-end {
align-self: flex-end;
}
.flex-1 {
flex: 1 1 0%;
}
.rounded {
border-radius: 100%;
}
.generate-atomic-classes(@prefix, @property, @unit: none, @start, @end, @step: 1) {
.unit-check() when (@unit = none) {
.loop-properties(@index) when (@index <= @end) {
.@{prefix}-@{index} {
@{property}: @index;
}
.loop-properties(@index + @step);
}
.loop-properties(@start);
}
.unit-check() when (@unit = px) {
.loop-properties(@index) when (@index <= @end) {
.@{prefix}-@{index}@{unit} {
@{property}: unit(@index, @unit);
}
.loop-properties(@index + @step);
}
.loop-properties(@start);
}
.unit-check() when (@unit = pe) {
.loop-properties(@index) when (@index <= @end) {
.@{prefix}-@{index}@{unit} {
@{property}: @index * 1%;
}
.loop-properties(@index + @step);
}
.loop-properties(@start);
}
.unit-check() when (not (@unit = none) and not (@unit = px) and not (@unit = pe)) {
.loop-properties(@index) when (@index <= @end) {
.@{prefix}-@{index}@{unit} {
@{property}: unit(@index, @unit);
}
.loop-properties(@index + @step);
}
.loop-properties(@start);
}
.unit-check();
}
.generate-atomic-classes(w, width, px, 1, 300);
.generate-atomic-classes(w, width, pe, 1, 100);
.generate-atomic-classes(h, height, px, 1, 100);
.generate-atomic-classes(h, height, pe, 1, 100);
.generate-atomic-classes(m, margin, px, 1, 100);
.generate-atomic-classes(ml, margin-left, px, 1, 100);
.generate-atomic-classes(mt, margin-top, px, 1, 100);
.generate-atomic-classes(mr, margin-right, px, 1, 100);
.generate-atomic-classes(mb, margin-bottom, px, 1, 100);
.generate-atomic-classes(p, padding, px, 1, 100);
.generate-atomic-classes(pl, margin-left, px, 1, 100);
.generate-atomic-classes(pt, margin-top, px, 1, 100);
.generate-atomic-classes(pr, margin-right, px, 1, 100);
.generate-atomic-classes(pb, margin-bottom, px, 1, 100);
.m-a{
margin-left: auto;
margin-right: auto;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.w-full {
width: 100%;
}
.w-1-2 {
width: 50%;
}
.w-1-3 {
width: 33.333%;
}
.w-1-4 {
width: 25%;
}
.w-1-5 {
width: 20%;
}
.h-full {
height: 100%;
}
.font-bold {
font-weight: bold;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.color-white {
color: #fff;
}
.color-333 {
color: #333;
}
.color-666 {
color: #666;
}
.color-999 {
color: #999;
}
.color-pink {
color: deeppink;
}
.color-blue {
color: deepskyblue;
}
.bg-white {
background: #fff;
}
.bg-333 {
background: #333;
}
.bg-dedede {
background: #dedede;
}
.bg-e1e1e1 {
background: #e1e1e1;
}
.bg-f1f1f1 {
background: #f1f1f1;
}
.color-blue {
color: rgb(0, 175, 254)
}
.bg-blue {
background: rgb(0, 175, 254)
}
.bg-pink {
background-color: rgb(255, 233, 246);
}
.overflow-hidden {
overflow: hidden;
}
.border-box{
box-sizing: border-box;
}
scss
.flex {
display: flex
}
.flex-x {
flex-direction: row
}
.flex-y {
flex-direction: column
}
.flex-x-start {
justify-content: flex-start
}
.flex-x-center {
justify-content: center
}
.flex-x-end {
justify-content: flex-end
}
.flex-x-between {
justify-content: space-between
}
.flex-x-around {
justify-content: space-around
}
.flex-x-evenly {
justify-content: space-evenly
}
.flex-y-start {
align-items: flex-start
}
.flex-y-center {
align-items: center
}
.flex-y-end {
align-items: flex-end
}
.flex-wrap {
flex-wrap: wrap;
}
.self-start {
align-self: flex-start;
}
.self-center {
align-self: flex-center;
}
.self-end {
align-self: flex-end;
}
.flex-1 {
flex: 1 1 0%;
}
.rounded {
border-radius: 100%;
}
@for $i from 1 through 100 {
.w-#{$i}vw {
width: #{$i}vw;
}
.h-#{$i}vh {
height: #{$i}vh;
}
}
@for $i from 0 through 900 {
.w-#{$i}px {
width: #{$i}rpx;
}
.h-#{$i}px {
height: #{$i}rpx;
}
.leading-#{$i}px {
line-height: #{$i}rpx;
}
.p-#{$i}px {
padding: #{$i}rpx;
}
.px-#{$i}px {
padding-left: #{$i}rpx;
padding-right: #{$i}rpx;
}
.py-#{$i}px {
padding-top: #{$i}rpx;
padding-bottom: #{$i}rpx;
}
.pl-#{$i}px {
padding-left: #{$i}rpx;
}
.pr-#{$i}px {
padding-right: #{$i}rpx;
}
.pt-#{$i}px {
padding-top: #{$i}rpx;
}
.pb-#{$i}px {
padding-bottom: #{$i}rpx;
}
.m-#{$i}px {
margin: #{$i}rpx;
}
.mx-#{$i}px {
margin-left: #{$i}rpx;
margin-right: #{$i}rpx;
}
.my-#{$i}px {
margin-top: #{$i}rpx;
margin-bottom: #{$i}rpx;
}
.ml-#{$i}px {
margin-left: #{$i}rpx;
}
.mr-#{$i}px {
margin-right: #{$i}rpx;
}
.mt-#{$i}px {
margin-top: #{$i}rpx;
}
.mb-#{$i}px {
margin-bottom: #{$i}rpx;
}
.rounded-#{$i}px {
border-radius: #{$i}rpx;
}
.text-#{$i}px {
font-size: #{$i}rpx;
}
.top-#{$i}px {
top: #{$i}rpx;
}
.right-#{$i}px {
right: #{$i}rpx;
}
.bottom-#{$i}px {
bottom: #{$i}rpx;
}
.left-#{$i}px {
left: #{$i}rpx;
}
}
.m-a{
margin-left: auto;
margin-right: auto;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.w-full {
width: 100%;
}
.w-1-2 {
width: 50%;
}
.w-1-3 {
width: 33.333%;
}
.w-1-4 {
width: 25%;
}
.w-1-5 {
width: 20%;
}
.h-full {
height: 100%;
}
.font-bold {
font-weight: bold;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.color-white {
color: #fff;
}
.color-333 {
color: #333;
}
.color-666 {
color: #666;
}
.color-999 {
color: #999;
}
.color-pink {
color: deeppink;
}
.color-blue {
color: deepskyblue;
}
.bg-white {
background: #fff;
}
.bg-333 {
background: #333;
}
.bg-dedede {
background: #dedede;
}
.bg-e1e1e1 {
background: #e1e1e1;
}
.bg-f1f1f1 {
background: #f1f1f1;
}
.color-blue {
color: rgb(0, 175, 254)
}
.bg-blue {
background: rgb(0, 175, 254)
}
.bg-pink {
background-color: rgb(255, 233, 246);
}
.overflow-hidden {
overflow: hidden;
}
.border-box{
box-sizing: border-box;
}