feat(Button): `mat-inline` styles to match Material button w/ icon specs
See original GitHub issueFeature Description
It would be nice to add some styles to a mat-icon
within a mat-button
so that it more closely matches the design specs found in Material Design. This could potentially take the form of a new attribute, mat-inline
, placed on a mat-button
.
This is an image of what I’m imagining a regular mat-button
compared against a mat-inline mat-button
would look like:
Sample Usage
<button mat-flat-button mat-inline color="accent">
<mat-icon>account_circle</mat-icon>
W/ Inline
</button>
Potential Implementation
.mat-button-base[mat-inline] {
.mat-button-wrapper {
display: flex;
align-items: center;
}
.mat-icon {
height: 18px;
width: 18px;
font-size: 18px;
margin: 0 8px 0 -4px;
}
}
[dir='rtl'] .mat-button-base[mat-inline] .mat-icon {
margin: 0 -4px 0 8px;
}
Use Case
Whenever a user is creating an icon button, a user wouldn’t have to refer to the material documentation & have to add these styles manually within their projects.
It helps to ensure alignment with Material’s specs.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Change size of mat-icon-button - Stack Overflow
You may want to increase the button size to something like 64. This answer works but doesn't scale up well, not for 64....
Read more >Icon buttons - Material Design
Note: For buttons with both icons and text, use the mdc-button component. ... Material Design spec advises that touch targets should be at...
Read more >Material Design Lite components
Material Design Lite (MDL) is a library of components for web developers based on Google's Material Design Philosophy: "A visual language for our...
Read more >Buttons with icons - Leonardo Fernandes
We can use this to our advantage: by making each button be an inline-table , we can turn icons into a table-cell ,...
Read more >Icon Button CSS Styling Guide
Icon + Text Button · aria-hidden="true" - allows assistive tech to skip the SVG since it's decorative and not providing any semantic value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we’ll move it to our consideration list.
You can find more details about the feature request process in our documentation.
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.