|
- // mixin
- @use "sass:math";
- $background: #f2f4f5;
- $blue: #2599ff;
- $next: #8bc6fa;
- $border_color: #d1d1d1;
- $green: #189b3b;
- $next_green: #8ccd9d;
- $red: #ff8c8c;
- $com_blue: #2ea7e0;
- $com_red: #ff5f8b;
- $com_light_green: #8dc21f;
-
- // 灰色线条
- $lineGray: #F5F5F5;
-
- // 清除浮动
- @mixin clearfix {
- &:after {
- content: "";
- display: table;
- clear: both;
- }
- }
-
- // 多行隐藏
- @mixin textoverflow($clamp:1) {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- -o-text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: $clamp;
- /*! autoprefixer: ignore next */
- -webkit-box-orient: vertical;
- }
-
- //flex box
- @mixin flexbox($jc:space-between, $ai:center, $fd:row, $fw:nowrap) {
- display: flex;
- display: -webkit-flex;
- flex: 1;
- justify-content: $jc;
- -webkit-justify-content: $jc;
- align-items: $ai;
- -webkit-align-items: $ai;
- flex-direction: $fd;
- -webkit-flex-direction: $fd;
- flex-wrap: $fw;
- -webkit-flex-wrap: $fw;
- }
- // 雪碧图路径
- /* @mixin icon($spriteUrl) {
- background: transparent url($spriteUrl) no-repeat;
- background-size: 400px 400px;
- } */
- @mixin icon {
- background: transparent url('~@/assets/icon.png') no-repeat;
- background-size: 400px 400px;
- }
- @mixin bgPosition(
- $spriteWidth,
- $spriteHeight,
- $iconWidth,
- $iconHeight,
- $iconX,
- $iconY
- ) {
- background-position: (
- math.div($iconX ,($spriteWidth - $iconWidth)) * 100%
- math.div($iconY,($spriteHeight - $iconHeight)) * 100%
- );
- }
-
- @mixin icon_position($iconWidth, $iconHeight, $iconX, $iconY) {
- $spriteWidth: 400;
- $spriteHeight: 400;
- @include bgPosition(
- $spriteWidth,
- $spriteHeight,
- $iconWidth,
- $iconHeight,
- $iconX,
- $iconY
- );
- }
- @mixin border {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- top: -50%;
- right: -50%;
- bottom: -50%;
- left: -50% !important;
- border-bottom: 1px solid $border_color;
- -webkit-transform: scale(.5);
- transform: scale(.5);
- }
-
- @mixin colorAndFont($color, $fontSize) {
- color: $color;
- font-size: $fontSize + px;
- }
-
- @mixin center {
- display: flex;
- justify-content: center;
- align-items: center;
- }
- @mixin bgimg($path, $width, $height) {
- background-image: $path;
- background-size: $width, $height;
- width: $width + px;
- height: $height + px;
- display: flex;
- justify-content: center;
- align-items: center;
- }
|