Skip to content

Commit

Permalink
feat(iconbutton): add touch target configs
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 556114164
  • Loading branch information
asyncLiz authored and Copybara-Service committed Aug 11, 2023
1 parent 88eec0c commit 0862c58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions iconbutton/internal/_icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
width: var(--_state-layer-size);
}

:host([touch-target='wrapper']) {
margin: max(0px, (48px - var(--_state-layer-size)) / 2);
}

md-focus-ring {
@include focus-ring.theme(
(
Expand Down
9 changes: 9 additions & 0 deletions iconbutton/internal/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
justify-content: center;
}

:host([touch-target='wrapper']) {
margin: max(0px, (48px - var(--_container-size)) / 2);
}

md-focus-ring {
@include focus-ring.theme(
(
Expand All @@ -49,6 +53,7 @@
display: flex;
justify-content: center;
outline: none;
padding: 0;
position: relative;
text-decoration: none;
user-select: none;
Expand Down Expand Up @@ -100,4 +105,8 @@
width: 48px;
transform: translate(-50%, -50%);
}

:host([touch-target='none']) .touch {
display: none;
}
}

0 comments on commit 0862c58

Please sign in to comment.