File tree 3 files changed +90
-55
lines changed
3 files changed +90
-55
lines changed Original file line number Diff line number Diff line change 22
22
tokens .$default-map : components .$post-button ;
23
23
24
24
.btn {
25
- // Resets
26
- display : inline-flex ;
27
- position : relative ;
28
- align-items : center ;
29
- justify-content : center ;
30
- max-width : 100% ;
31
- overflow : hidden ;
32
- transition : button .$btn-transition ;
33
- border-width : tokens .get (' button-border-width' );
34
- border-style : solid ;
35
- border-radius : tokens .get (' button-border-radius-round' );
36
- background-color : transparent ;
37
- box-shadow : none ;
38
- font-family : inherit ;
39
- font-weight : tokens .get (' button-label-font-weight' );
40
- text-decoration : none ;
41
- white-space : nowrap ; // Long content should never break in buttons
42
-
43
- & :hover {
44
- text-decoration : none ;
45
- }
46
-
47
- @include button-mx .button-size ();
48
-
49
- & :disabled {
50
- border-style : tokens .get (' button-border-style-disabled' );
51
- }
52
-
53
- @include utilities .focus-style ;
54
-
55
- @include utilities .high-contrast-mode () {
56
- & :is (a ) {
57
- color : LinkText;
58
- border : unset ;
59
- }
60
-
61
- & :is (button ) {
62
- background-color : ButtonFace !important ;
63
- border : 1px solid ButtonBorder !important ;
64
- }
65
-
66
- & :not (:disabled , .disabled ) {
67
- & :is (button ):hover {
68
- background-color : Highlight !important ;
69
-
70
- > post-icon {
71
- color : HighlightText !important ;
72
- }
73
- }
74
- }
75
- }
25
+ @extend %btn ;
76
26
}
77
27
78
28
// Type variants
Original file line number Diff line number Diff line change 1
1
@use ' button' ;
2
2
@use ' ./../mixins/media' ;
3
+ @use ' ../functions/tokens' ;
4
+ @use ' ../tokens/components' ;
5
+ @use ' ./../mixins/button' as button-mx ;
6
+ @use ' ./../mixins/utilities' ;
7
+ @use ' ./../placeholders/button' as button-ph ;
8
+
9
+ tokens .$default-map : components .$post-button ;
3
10
4
11
.target-group {
5
12
gap : 4px ;
12
19
}
13
20
14
21
a {
15
- @extend .btn ;
16
- @extend .btn-tertiary ;
17
- border : none ;
22
+ @extend %btn ;
23
+ border : unset ;
18
24
font-weight : 400 ;
19
25
padding : 4px 16px ;
20
26
min-height : 0 ;
21
27
font-size : 1rem ;
28
+
29
+ @include button-mx .button-variant-def (' enabled' , ' tertiary' );
30
+
31
+ & :disabled {
32
+ @include button-mx .button-variant-def (' disabled' , ' tertiary' );
33
+ }
34
+
35
+ @include utilities .not-disabled-hover () {
36
+ @include button-mx .button-variant-def (' hover' , ' tertiary' );
37
+ }
22
38
}
23
39
24
40
a .active {
25
- @extend .btn-primary ;
41
+ box-shadow : tokens .get (' button-elevation' );
42
+
43
+ @include button-mx .button-variant-def (' enabled' , ' primary' );
44
+
45
+ & :disabled {
46
+ @include button-mx .button-variant-def (' disabled' , ' primary' );
47
+ }
48
+
49
+ @include utilities .not-disabled-hover () {
50
+ @include button-mx .button-variant-def (' hover' , ' primary' );
51
+ }
26
52
}
27
53
28
54
@include media .max (lg) {
Original file line number Diff line number Diff line change 2
2
@use ' ./../mixins/color' as color-mx ;
3
3
@use ' ./../variables/color' ;
4
4
@use ' ./../variables/components/button' ;
5
+ @use ' ./../mixins/button' as button-mx ;
6
+ @use ' ../functions/tokens' ;
7
+ @use ' ../tokens/components' ;
8
+
9
+ tokens .$default-map : components .$post-button ;
5
10
6
11
%btn-transparent-background {
7
12
@include utilities .not-disabled-focus-hover () {
13
18
color : color .$black ;
14
19
}
15
20
}
21
+
22
+ %btn {
23
+ // Resets
24
+ display : inline-flex ;
25
+ position : relative ;
26
+ align-items : center ;
27
+ justify-content : center ;
28
+ max-width : 100% ;
29
+ overflow : hidden ;
30
+ transition : button .$btn-transition ;
31
+ border-width : tokens .get (' button-border-width' );
32
+ border-style : solid ;
33
+ border-radius : tokens .get (' button-border-radius-round' );
34
+ background-color : transparent ;
35
+ box-shadow : none ;
36
+ font-family : inherit ;
37
+ font-weight : tokens .get (' button-label-font-weight' );
38
+ text-decoration : none ;
39
+ white-space : nowrap ; // Long content should never break in buttons
40
+
41
+ & :hover {
42
+ text-decoration : none ;
43
+ }
44
+
45
+ @include button-mx .button-size ();
46
+
47
+ & :disabled {
48
+ border-style : tokens .get (' button-border-style-disabled' );
49
+ }
50
+
51
+ @include utilities .focus-style ;
52
+
53
+ @include utilities .high-contrast-mode () {
54
+ & :is (a ) {
55
+ color : LinkText;
56
+ border : unset ;
57
+ }
58
+
59
+ & :is (button ) {
60
+ background-color : ButtonFace !important ;
61
+ border : 1px solid ButtonBorder !important ;
62
+ }
63
+
64
+ & :not (:disabled , .disabled ) {
65
+ & :is (button ):hover {
66
+ background-color : Highlight !important ;
67
+
68
+ > post-icon {
69
+ color : HighlightText !important ;
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
You can’t perform that action at this time.
0 commit comments