基于sass的样式工具 发表于 2018-04-15 | 分类于 sass相关 | 本文总阅读量 次 scss 实用工具样式,开箱即用。 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172$color-primary: #F56C6C;$color-danger: #409EFF;$color-info: #909399;$color-success: #67C23A;$color-warning: #E6A23C;.f-l{ float:left !important; _display: inline;}.f-r{ float:right !important; _display: inline;}.clearfix { &:after { display: block; overflow: hidden; font-size: 0; content: " "; clear: both; height: 0; }}.text-r{ text-align: right;}.text-l{ text-align: left;}.text-c{ text-align: center;}// 单行溢出省略号....text-overflow-1{ display: block !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap}// 多行溢出省略号....text-overflow-2{ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;}.block-center{ margin: 0 auto;}.boxsizing-border{ box-sizing: border-box;}//弹性布局.flex{ display: -webkit-flex; display: flex; flex-wrap: wrap; //单行放不下时换行 align-items: flex-start; //交叉轴从轴开始的位置开始排列}//主轴对齐方式-居中对齐.justify-c{ justify-content: center;}.justify-start{ justify-content: flex-start;}// margin-* padding-* 的快捷类使用 0---45px$total: 45;@while $total >= 0 { .mt-#{$total}{ margin-top: #{$total}px; } .mr-#{$total}{ margin-right: #{$total}px; } .mb-#{$total}{ margin-bottom: #{$total}px; } .ml-#{$total}{ margin-left: #{$total}px; } .pt-#{$total}{ padding-top: #{$total}px; } .pr-#{$total}{ padding-right: #{$total}px; } .pb-#{$total}{ padding-bottom: #{$total}px; } .pl-#{$total}{ padding-left: #{$total}px; } $total: $total - 1;}// 字体颜色.fc-primary { color: $color-primary;}.fc-danger { color: $color-danger;}//字体大小$total-f: 30;@while $total-f >= 8 { .f-#{$total-f}{ font-size: #{$total-f}px; } $total-f: $total-f - 2;}// label.h-label{ display: inline-block; float: right; padding-right: 15px; line-height: 34px; color: #4A4A4A; font-weight: normal; &.h-star::before{ content: "*"; color: #F56C6C; display: inline; margin-right: 4px; }}.h-text{ display: inline-block; float: left; line-height: 34px; color: #4A4A4A; font-weight: normal;}