| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- /**
- * 默认主题下 $color-border-light
- */
- $color-border-light: #979797;
- @mixin hairline-common() {
- content: "";
- position: absolute;
- transform-origin: center;
- box-sizing: border-box;
- pointer-events: none;
- }
- @mixin hairline-base($color: $color-border-light, $style: solid) {
- @include hairline-common();
- top: -50%;
- left: -50%;
- right: -50%;
- bottom: -50%;
- border: 0 $style $color;
- transform: scale(0.5);
- }
- @mixin hairline-surround(
- $color: $color-border-light,
- $style: solid,
- $width: 1px
- ) {
- position: relative;
- &::after {
- @include hairline-base($color, $style);
- border-width: $width;
- }
- }
- @mixin hairline-top($color: $color-border-light, $style: solid, $width: 1px) {
- position: relative;
- &::after {
- @include hairline-base($color, $style);
- border-top-width: $width;
- }
- }
- @mixin hairline-bottom(
- $color: $color-border-light,
- $style: solid,
- $width: 1px
- ) {
- position: relative;
- &::after {
- @include hairline-base($color, $style);
- border-bottom-width: $width;
- }
- }
- @mixin hairline-left($color: $color-border-light, $style: solid, $width: 1px) {
- position: relative;
- &::after {
- @include hairline-base($color, $style);
- border-left-width: $width;
- }
- }
- @mixin hairline-right($color: $color-border-light, $style: solid, $width: 1px) {
- position: relative;
- &::after {
- @include hairline-base($color, $style);
- border-right-width: $width;
- }
- }
- @mixin hairline-top-bottom(
- $color: $color-border-light,
- $style: solid,
- $width: 1px
- ) {
- position: relative;
- &::after {
- @include hairline-base($color, $style);
- border-top-width: $width;
- border-bottom-width: $width;
- }
- }
- @mixin hairline-bottom-relative(
- $color: $color-border-light,
- $style: solid,
- $width: 1px,
- $left: 0
- ) {
- position: relative;
- &::after {
- @include hairline-common();
- top: auto;
- left: $left;
- right: 0;
- bottom: 0;
- transform: scaleY(0.5);
- border-bottom: $width $style $color;
- }
- }
- @mixin hairline-top-relative(
- $color: $color-border-light,
- $style: solid,
- $width: 1px,
- $left: 0
- ) {
- position: relative;
- &::before {
- @include hairline-common();
- top: 0;
- left: $left;
- right: 0;
- bottom: auto;
- transform: scaleY(0.5);
- border-top: $width $style $color;
- }
- }
- @mixin hairline-left-relative(
- $color: $color-border-light,
- $style: solid,
- $width: 1px,
- $top: 0
- ) {
- position: relative;
- &::after {
- @include hairline-common();
- top: $top;
- left: 0;
- right: auto;
- bottom: 0;
- transform: scaleX(0.5);
- border-left: $width $style $color;
- }
- }
- @mixin hairline-right-relative(
- $color: $color-border-light,
- $style: solid,
- $width: 1px,
- $top: 0
- ) {
- position: relative;
- &::after {
- @include hairline-common();
- top: $top;
- left: auto;
- right: 0;
- bottom: 0;
- transform: scaleX(0.5);
- border-right: $width $style $color;
- }
- }
- @mixin line($num: 1) {
- overflow: hidden;
- text-overflow: ellipsis;
- @if ($num == 1) {
- white-space: nowrap;
- } @else {
- display: -webkit-box;
- -webkit-line-clamp: $num;
- /* autoprefixer: off */
- -webkit-box-orient: vertical;
- }
- }
- /**
- * 点击态
- */
- @mixin active {
- transition: background-color 0.3s;
- &:active {
- background-color: #f2f2f2;
- }
- }
|