Skip to content

Conversation

essjay05
Copy link
Contributor

@essjay05 essjay05 commented Jan 24, 2025

Updates Angular Components Button styles for icon buttons to add pseudo class styles to increase the icon buttons' target size.

Before screenshot
Updated after screenshot with refactor:
After screenshot

Fixes b/378903269

@essjay05 essjay05 requested a review from a team as a code owner January 24, 2025 00:36
@essjay05 essjay05 requested review from crisbeto and wagnermaciel and removed request for a team January 24, 2025 00:36
Updates Angular Components Button styles for icon buttons to
add pseudo class styles to increase the icon buttons' target
size.

Fixes b/378903269
@essjay05 essjay05 force-pushed the increase-icon-button-touch-target branch from 098a039 to 4051dd0 Compare January 24, 2025 17:30
Updates previous fix to increasing Angular Components Icon Button by
removing the pseudo class styles and targeting the correct class
.mat-mdc-button-touch-target instead. Also, removes any redundant
styles simplifies the necessary styles to increase the touch target.
@essjay05 essjay05 requested a review from crisbeto January 24, 2025 18:17

.mat-mdc-button-touch-target {
display: block;
opacity: 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This element is already transparent so I'm not sure what the opacity is doing here.

}

.mat-mdc-button-touch-target {
display: block;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is controlled through the touch-target-display token. The problem we had was that in some densities the buttons become too small and the touch targets overlap when icon buttons are next to each other. It might be better to tackle this through documentation than to increase the touch target.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @crisbeto! Noted! Thanks for the explanation. It looks like in the dev-app demo is where specifically that touch-target-display token seems to be applying the display: none and that in the actual XAP gallery that the touch target is already 48x48 and clickable outside the visual grey icon button. I'm closing this as WAI.

@essjay05
Copy link
Contributor Author

Closing because it looks like outside of dev-app the icon is WAI. Will make a separate document update to note/be aware of making icon button touch-target 48x48.

@essjay05 essjay05 closed this Jan 27, 2025
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants