Skip to content

Commit 641eb4e

Browse files
committed
feat(unity-bootstrap-theme): added mixin to expand clickable area for btn
UDS-1970
1 parent 27e3819 commit 641eb4e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/unity-bootstrap-theme/src/scss/extends/_buttons.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
1rem;
66
}
77

8+
@mixin clickable-area($min-width: 80px, $min-height: 44px) {
9+
position: relative;
10+
&::before {
11+
content: "";
12+
position: absolute;
13+
min-width: $min-width;
14+
min-height: $min-height;
15+
z-index: -1;
16+
inset: 0;
17+
margin: auto;
18+
}
19+
}
20+
821
// Extra styles that don't have bootstrap variables to override
922
.btn {
1023
text-decoration: none;
@@ -20,11 +33,14 @@
2033
}
2134
&.btn-md {
2235
@include btn-md;
36+
@include clickable-area(80px, 44px);
2337
}
2438
&.btn-sm {
2539
font-size: 0.75rem;
2640
padding: $uds-component-button-padding-y-small
2741
$uds-component-button-padding-x-small;
42+
43+
@include clickable-area(64px, 44px);
2844
}
2945
&.btn-tag {
3046
font-size: 0.75rem;

0 commit comments

Comments
 (0)