forked from carbon-design-system/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_link.scss
116 lines (96 loc) · 2.52 KB
/
_link.scss
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
// Copyright IBM Corp. 2016, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
@use '../../config' as *;
@use '../../motion' as *;
@use '../../spacing' as *;
@use '../../theme' as *;
@use '../../type';
@use '../../utilities/component-reset';
@use '../../utilities/custom-property';
@use '../../utilities/focus-outline' as *;
$link-text-color: custom-property.get-var('link-text-color', $link-primary);
$link-hover-text-color: custom-property.get-var(
'link-hover-text-color',
$link-primary-hover
);
$link-focus-text-color: custom-property.get-var(
'link-focus-text-color',
$focus
);
/// Link styles
/// @access public
/// @group link
@mixin link {
.#{$prefix}--link {
@include component-reset.reset;
@include type.type-style('body-compact-01');
display: inline-flex;
color: $link-text-color;
outline: none;
text-decoration: none;
transition: color $duration-fast-01 motion(standard, productive);
&:hover {
color: $link-hover-text-color;
text-decoration: underline;
}
&:active,
&:active:visited,
&:active:visited:hover {
color: $text-primary;
text-decoration: underline;
}
&:focus {
@include focus-outline;
outline-color: $link-focus-text-color;
}
&:visited {
color: $link-primary;
}
&:visited:hover {
color: $link-primary-hover;
}
}
.#{$prefix}--link--disabled,
.#{$prefix}--link--disabled:hover {
@include component-reset.reset;
@include type.type-style('body-compact-01');
color: $text-disabled;
cursor: not-allowed;
font-weight: 400;
text-decoration: none;
}
.#{$prefix}--link.#{$prefix}--link--visited:visited {
color: $link-visited;
}
.#{$prefix}--link.#{$prefix}--link--visited:visited:hover {
color: $link-primary-hover;
}
.#{$prefix}--link.#{$prefix}--link--inline {
display: inline;
text-decoration: underline;
&:focus,
&:visited {
text-decoration: none;
}
}
.#{$prefix}--link--disabled.#{$prefix}--link--inline {
text-decoration: underline;
}
.#{$prefix}--link--sm,
.#{$prefix}--link--sm.#{$prefix}--link--disabled:hover {
@include type.type-style('helper-text-01');
}
.#{$prefix}--link--lg,
.#{$prefix}--link--lg.#{$prefix}--link--disabled:hover {
@include type.type-style('body-compact-02');
}
.#{$prefix}--link__icon {
display: inline-flex;
align-self: center;
margin-left: $spacing-03;
}
}