angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.33k stars 6.73k forks source link

mat-icon: Choose between Filled, Outlined, Rounded, Two-Tone and Sharp icons; #14853

Open Joaovtrc opened 5 years ago

Joaovtrc commented 5 years ago

Please describe the feature you would like to request.

To be able to select between Filled, Outlined, Rounded, Two-Tone and Sharp when using mat-icon;

What is the use-case or motivation for this proposal?

An easy way to use the new icons available on https://material.io/tools/icons/?style=baseline (without having to manually put the SVG's of the icons you want)

reumerd commented 5 years ago

This seems partly supported, but not for all icons. e.g. Delete and Label have an outline version by using delete_outline as label, but print and edit do not have an oultine version available in angular material.

Flashunt commented 5 years ago

Hi! Some news?

max-SS commented 5 years ago

<mat-icon appearance="outline">mail</mat-icon>

as well as? https://material.angular.io/components/form-field/overview#form-field-appearance-variants :3

bisonfoutu commented 5 years ago

Hi, I've just been playing around with this and it seems like there is already a way to do this more easily.

You need to do two things:

  1. Change the font url to add the alternative styles you want to use. For example: https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp

  2. Use the fontSet attribute on <mat-icon> to specify the style you want to apply. Here's an example to display a round home icon: <mat-icon fontSet="material-icons-round">home</mat-icon>.

Not as straight-forward as writing <mat-icon>home_round</mat-icon>, but I can definitely live with that. Wouldn't hurt mentioning this solution in the docs though.

In the meantime, hope this will help 😃

angular-robot[bot] commented 2 years ago

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-robot[bot] commented 2 years ago

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.