Angular Material does not only provide system variables for colors and typography, but also for other properties like shape, and shadow.
Shape
Let’s try to modify the shape of the dialog and buttons & form fields inside the dialog. We want to make them look sharper.
Create a new file _shape.scss in the styles folder and add the following code:
@use "@angular/material" as mat;
$sharp-radius: 0;
.sharp { @include mat.theme-overrides( ( // for mat-buttons corner-full: $sharp-radius, // for dialog container corner-extra-large: $sharp-radius, // for form fields corner-extra-small: $sharp-radius ) );}Next, add shape styles in src/styles.scss file.
@use "./styles/shape";And lastly, add the sharp class as panelClass to the dialog.
@Component({})export class AppComponent { openAddTodoDialog(): void { const dialogRef = this.dialog.open(TodoFormDialogComponent, { disableClose: true, panelClass: 'sharp', });
// rest remains same }}Below is the list of system variables for shape:
corner-extra-largecorner-extra-large-topcorner-extra-smallcorner-extra-small-topcorner-fullcorner-largecorner-large-endcorner-large-startcorner-large-topcorner-mediumcorner-nonecorner-small
Shadow
Next, let’s try to modify the shadow of the add todo fab button.
Go to src/app/app.component.scss and add the following code:
.add-todo-fab { @include mat.theme-overrides(( level3: 0 4px 6px 1px var(--mat-sys-surface-dim), ));}Below is the list of system variables for shadow:
level0level1level2level3level4level5