angular / angular/components

docs-bug(theming): Example with define-theme is outdated

オープン
#30,701 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
area: theming docs P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

material.angular.io/guide/theming#density の theming ガイドの density セクションから始め、ドキュメントに記載されている例と、issue に示されている define-theme の設定を比較します。古い例を更新して、その density 設定が期待されるコードと一致するようにし、typography の例にも同じ問題があるか確認します。ガイドに報告されたエラーを発生させる設定が表示されなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, sass
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。