Reputation: 3264
I'm using Angular Material 7, and find the gutter spacing of the mat-form-field et. al. to be too large. On the desktop, the information density is very low. I'd like to adjust this using theming, but Google only leads me to tutorials describing how to change colors. Does anyone have advice on how to make the spacing more compact without debugging dozens of Material css directives?
Upvotes: 4
Views: 6175
Reputation: 1031
You can set up density level at your theme definition like this:
$app-light-theme: mat-light-theme((
color: (
primary: $mat-primary-palette,
accent: $mat-accent-palette
),
density: -3
));
Upvotes: 1
Reputation: 2175
Material design has different density levels, Angular team finally implemented this and it is now an experimental feature in Angular 10 release.
Upvotes: 2
Reputation: 318
If you don't want to use css for your grid gutter size, you can use angular material with flex-layout and easily set your gutter size using fxLayoutGap="16px or 20px". Here is the link fxLayoutGap API.
Upvotes: 0