@mixin border-bottom-1px($color) {
|
position: relative;
|
&::after {
|
position: absolute;
|
box-sizing: border-box;
|
content: " ";
|
pointer-events: none;
|
right: 0;
|
bottom: 0;
|
left: 0;
|
width: 100%;
|
height: 1px;
|
background-color: $color;
|
@media (-webkit-min-device-pixel-ratio: 2) {
|
transform: scaleY(0.5);
|
}
|
}
|
}
|
|
@mixin border-top-1px($color) {
|
position: relative;
|
&::after {
|
position: absolute;
|
box-sizing: border-box;
|
content: " ";
|
pointer-events: none;
|
right: 0;
|
top: 0;
|
left: 0;
|
width: 100%;
|
height: 1px;
|
background-color: $color;
|
@media (-webkit-min-device-pixel-ratio: 2) {
|
transform: scaleY(0.5);
|
}
|
}
|
}
|
|
@mixin border($color, $radius) {
|
position: relative;
|
&::after {
|
position: absolute;
|
box-sizing: border-box;
|
content: " ";
|
pointer-events: none;
|
top: 0;
|
right: 0;
|
bottom: 0;
|
left: 0;
|
width: 200%;
|
height: 200%;
|
position: absolute;
|
top: 0;
|
left: 0;
|
border: 1px solid red;
|
border-radius: 4px;
|
-webkit-transform: scale(0.5, 0.5);
|
transform: scale(0.5, 0.5);
|
transform-origin: top left;
|
-webkit-transform-origin: top left;
|
border-radius: $radius;
|
@media (-webkit-min-device-pixel-ratio: 2) {
|
transform: scaleY(0.5);
|
}
|
}
|
}
|
|
@mixin text-overflow() {
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
overflow: hidden;
|
}
|
|
@mixin text-overflow-line($line-number: 2) {
|
display: -webkit-box !important;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
-webkit-line-clamp: $line-number;
|
/*! autoprefixer: ignore next */
|
-webkit-box-orient: vertical;
|
}
|
|
@mixin flex-center($direction: row) {
|
display: flex;
|
flex-direction: $direction;
|
align-items: center;
|
justify-content: center;
|
}
|
|
// fix定位到页面底部
|
@mixin fix-bottom($height) {
|
position: fixed;
|
bottom: calc(constant(safe-area-inset-bottom) + $height);
|
bottom: calc(env(safe-area-inset-bottom) + $height);
|
}
|
|
@mixin scroll-y($width: 4) {
|
&::-webkit-scrollbar {
|
width: #{$width}px;
|
}
|
|
&::-webkit-scrollbar-thumb {
|
border-radius: 5px;
|
background: rgb(var(--gray-6));
|
}
|
|
&::-webkit-scrollbar-track {
|
background: transparent;
|
}
|
}
|
|
@mixin scroll-x($height: 4) {
|
&::-webkit-scrollbar {
|
height: #{$height}px;
|
}
|
&::-webkit-scrollbar-thumb {
|
border-radius: 5px;
|
background: rgb(var(--gray-6));
|
}
|
|
&::-webkit-scrollbar-track {
|
background: transparent;
|
}
|
}
|