-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a5f616
commit ceb933f
Showing
6 changed files
with
34 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,6 @@ | ||
$icon-size-xs: 20px; | ||
$icon-size-sm: 24px; | ||
$icon-size-md: 32px; | ||
$icon-size-sm: 20px; | ||
$icon-size-md: 24px; | ||
$icon-size-lg: 32px; | ||
|
||
// https://www.w3.org/WAI/WCAG21/Understanding/target-size.html | ||
$min-touch-target: 44px; | ||
|
||
@mixin touchable-icon($icon-size) { | ||
width: $icon-size; | ||
height: $icon-size; | ||
|
||
// Ensure minimum touch target size | ||
$touch-size: max($icon-size, $min-touch-target); | ||
min-width: $touch-size; | ||
min-height: $touch-size; | ||
|
||
// Center the icon within the touch target | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
// Add padding if icon is smaller than min touch target | ||
@if $icon-size < $min-touch-target { | ||
$padding: ($min-touch-target - $icon-size) / 2; | ||
padding: $padding; | ||
} | ||
} | ||
|
||
@mixin touchable-icon-xs { | ||
@include touchable-icon($icon-size-xs); | ||
} | ||
|
||
@mixin touchable-icon-sm { | ||
@include touchable-icon($icon-size-sm); | ||
} | ||
|
||
@mixin touchable-icon-md { | ||
@include touchable-icon($icon-size-md); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters