bug(Density): Setting the density via mat.all-component-densities gives different result than setting via mat.theme density #30681
Labels
needs triage
This issue needs to be triaged by the team
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When defining the density via mat.theme, e.g.
the button height is 40px (
--mdc-text-button-container-height
).However, using the
mat.all-component-densities(0)
mixin results in button height equals to 36px.Similar issue applies to other densities - setting the density through the mixin results in different height values than setting it through the
mat.theme
mixin.Reproduction
StackBlitz link: https://stackblitz.com/edit/czrubf43?file=src%2Fstyles.scss
Steps to reproduce:
changing density through the dropdown adds respectively classes to the body: .density0, .density-1 ... .density-5
the scss for those is (see styles.scss)
Expected Behavior
densities (component heights) set through
mat.all-component-densities(0)
should be the same when set throughmat.theme((density: 0))
Actual Behavior
densities (component heights) set through
mat.all-component-densities(0)
are different when set throughmat.theme((density: 0))
Environment
The text was updated successfully, but these errors were encountered: