angular / angular/components

One syntax for all types of mat-icon

Ouverte
#12,484 3 commentaires 5 réactions 0 personnes assignées Voir sur GitHub
area: material/icon feature P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### Bug, feature request, or proposal:

Feature request

#### What is the expected behavior?

Changing between ligature-based and class-based icon specification shouldn't be a huge chore.

#### What is the current behavior?

To use ligature-based icons, I write `home`. If I want to change from an icon font to a font set that uses CSS classes to pick a glyph, I'd have to change each component by hand to something like ``.

#### What is the use-case or motivation for changing an existing behavior?

I've created a large application that uses dozens of `mat-icon` components, and would like a simple method of changing how they're rendered. Ideally, I'd be able to call something like `setDefaultFontSetClass` once and have all icons (that don't explicitly set a `fontSet` attribute) change their source.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?

N/A, mat-icon has always behaved like this

#### Is there anything else we should know?

It would be great if either the `fontIcon` attribute or the component content could be used to select a glyph regardless of how the font set is provided, but I'd be happy to be told to just always use one or the other, as long as switching between types of font set using the icon registry is straightforward.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par lire le comportement du composant mat-icon et les API du registre d’icônes décrites dans l’issue, en vous concentrant sur la manière dont le contenu de ligature, fontIcon et fontSet sont sélectionnés. Le travail est terminé lorsqu’une grande application existante peut basculer entre des sources d’icônes basées sur les ligatures et basées sur des classes au moyen d’une seule configuration par défaut, sans modifier chaque utilisation de mat-icon.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.