zhangyong
2023-08-22 1353e87cb21a4032d585d7404bae9042f2ebcf08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@use 'sass:map';
 
@use 'mixins/mixins' as *;
@use 'mixins/var' as *;
@use 'mixins/utils' as *;
@use 'common/var' as *;
 
@include b(link) {
  @include set-component-css-var('link', $link);
}
 
@include b(link) {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  position: relative;
  text-decoration: none;
  outline: none;
  cursor: pointer;
  padding: 0;
  font-size: getCssVar('link', 'font-size');
  font-weight: getCssVar('link', 'font-weight');
 
  color: getCssVar('link', 'text-color');
 
  &:hover {
    color: getCssVar('link', 'hover-text-color');
  }
 
  @include when(underline) {
    &:hover:after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      height: 0;
      bottom: 0;
      border-bottom: 1px solid getCssVar('link', 'hover-text-color');
    }
  }
 
  @include when(disabled) {
    color: getCssVar('link', 'disabled-text-color');
    cursor: not-allowed;
  }
 
  & [class*='#{$namespace}-icon-'] {
    & + span {
      margin-left: 5px;
    }
  }
 
  &.#{$namespace}-link--default {
    &:after {
      border-color: getCssVar('link', 'hover-text-color');
    }
  }
 
  @include e(inner) {
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
 
  @each $type in $types {
    &.#{$namespace}-link--#{$type} {
      @include css-var-from-global(('link', 'text-color'), ('color', $type));
      @include css-var-from-global(
        ('link', 'hover-text-color'),
        ('color', $type, 'light-3')
      );
      @include css-var-from-global(
        ('link', 'disabled-text-color'),
        ('color', $type, 'light-5')
      );
 
      &:after {
        border-color: getCssVar('link', 'text-color');
      }
 
      @include when(underline) {
        &:hover:after {
          border-color: getCssVar('link', 'text-color');
        }
      }
    }
  }
}