angular / angular/components

bug(theming): There is no way to read density scale from theme

Open
#30,236 0 comments 0 reactions 0 assignees View on GitHub
area: theming P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Is this a regression?

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

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

18

### Description

In Angular Material 18, developers could use Angular Material's theme's density scale, so that their custom components aligns with other Angular Material components.

In v18, developers could use `mat.get-theme-density($theme);` to get the scale. [Link to docs](https://v18.material.angular.io/guide/theming-your-components#reading-the-density-scale).

In v19, it's not clear how to get density scale from theme.

### Reproduction

Not needed.

### Expected Behavior

Developers should be able to read density scale in Angular Material 19.

### Actual Behavior

Developers are not able to read density scale in Angular Material 19.

### Environment

- Angular: 19
- CDK/Material: 19
- Browser(s): Edge
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Contributor guide

Open the contributing guide

Research direction

Start by comparing the Angular Material v18 theming guide's “reading the density scale” entry point with the v19 theming API. Determine how the density scale is represented in the v19 theme and expose an equivalent way for custom components to read it. Done means developers can retrieve the theme density scale in Angular Material 19.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.