angular / angular/components

bug(Theming Angular Material): Custom typography not applied to standard typography levels in mat.core-theme() or all-component-themes()

Abierto
#24,370 14 comentarios 6 reacciones 0 asignados Ver en GitHub
area: material/core area: theming docs P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

Tried to change the font-family so that e.g. body-1 everywhere has font family Arial.
But it only changed the font-family in mat components, not outside in normal divs.

```
$my-typography: mat.define-typography-config(
$font-family: 'Arial',
);
$my-theme: mat.define-light-theme((
typography: $my-typography,
color: (
primary: $dicey-primary,
accent: $dicey-accent,
warn: $dicey-warn,
))
);
@include mat.all-component-themes($my-theme);
```

Similar problem was reported here, but not solved: https://github.com/angular/components/issues/23683#issue-1015421891

-----------------------

It works when I do it with all-component-typographies:

```
$my-typography: mat.define-typography-config(
$font-family: 'Arial',
);
@include mat.all-component-typographies($my-typography);
```

### Reproduction

Steps to reproduce:
1. Add custom theme with typography
2. See if body tag font-family changes

### Expected Behavior

Bodys font family changes to custom font family

### Actual Behavior

The body font family is standard Roboto

### Environment

- Angular: 13.1.2
- CDK/Material: 13.1.1
- Browser(s): Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza reproduciendo el caso de Angular 13.1.2 del issue y compara mat.all-component-themes($my-theme) con mat.all-component-typographies($my-typography). Rastrea los mixins de tipografía utilizados por mat.core-theme() y all-component-themes(); se considera terminado cuando la fuente Arial configurada se aplica al body y a los niveles de tipografía estándar, no solo a los componentes de Material.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, sass, typescript
Área
design, frontend
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.