docs-bug(theming): Example with define-theme is outdated
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### 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
Documentation about define-theme seems to be outdated.
```
@use '@angular/material' as mat;
html {
@include mat.theme((
color: mat.$violet-palette,
typography: Roboto,
density: -2,
));
}
```
### Reproduction
You can check at:
https://material.angular.io/guide/theming#density
### Expected Behavior
The corret code should be:
```
$theme: mat.define-theme(
(
color: (
primary: mat.$azure-palette,
tertiary: mat.$violet-palette,
theme-type: light,
),
density: (
scale: -2,
),
)
);
```
### Actual Behavior
This code results in the following error:
`$config.density should be a density configuration object.`
I believe this error also occours with typography config.
### Environment
- Angular: 19
- CDK/Material: 19
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la section sur la densité du guide de theming à l’adresse material.angular.io/guide/theming#density et comparez l’exemple documenté avec la configuration define-theme présentée dans l’issue. Mettez à jour l’exemple obsolète afin que sa configuration de densité corresponde au code attendu, et vérifiez si l’exemple de typographie présente le même problème. La tâche est terminée lorsque le guide n’affiche plus de configuration qui produit l’erreur signalée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, sass
- Domaine
- documentation
- Type d'issue
- Documentation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 45/100