Update packages, switch to new material theming system and reduce density
This commit is contained in:
@@ -17,6 +17,7 @@ import hljs from 'highlight.js/lib/core';
|
||||
import json from 'highlight.js/lib/languages/json';
|
||||
import { provideMonacoEditor } from 'ngx-monaco-editor-v2';
|
||||
import { routes } from './app.routes';
|
||||
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
@@ -44,5 +45,11 @@ export const appConfig: ApplicationConfig = {
|
||||
enabled: !isDevMode(),
|
||||
registrationStrategy: 'registerWhenStable:30000',
|
||||
}),
|
||||
{
|
||||
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
||||
// Filled doesn't look great with low density, by default the label is lost, and adding
|
||||
// it back makes it look cramped
|
||||
useValue: { appearance: 'outline' },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
:host {
|
||||
display: block;
|
||||
border-radius: var(--mat-sidenav-container-shape);
|
||||
padding: var(--mat-sidenav-container-shape);
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
transition: background-color 100ms linear;
|
||||
overflow-x: hidden;
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.mat-tree {
|
||||
background-color: transparent;
|
||||
min-width: fit-content;
|
||||
}
|
||||
|
||||
.mat-tree-node {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
:host {
|
||||
display: block;
|
||||
border-radius: var(--mat-sidenav-container-shape);
|
||||
padding: var(--mat-sidenav-container-shape);
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
transition: background-color 100ms linear;
|
||||
|
||||
@@ -1,52 +1,34 @@
|
||||
@use "@angular/material" as mat;
|
||||
@use "./theme.scss";
|
||||
|
||||
@include mat.elevation-classes();
|
||||
@include mat.app-background();
|
||||
|
||||
@mixin custom-colours($theme) {
|
||||
.mat-toolbar {
|
||||
background-color: mat.get-theme-color($theme, tertiary-container);
|
||||
}
|
||||
|
||||
app-proto-definition-selector,
|
||||
app-file-tree {
|
||||
background-color: mat.get-theme-color($theme, secondary-container);
|
||||
transition: background-color 100ms linear;
|
||||
}
|
||||
|
||||
.droppable {
|
||||
background-color: mat.get-theme-color($theme, secondary, 40);
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
@include mat.elevation-classes();
|
||||
@include mat.app-background();
|
||||
@include mat.toolbar-theme(theme.$rose-theme);
|
||||
@include mat.button-theme(theme.$rose-theme);
|
||||
@include mat.tree-theme(theme.$rose-theme);
|
||||
@include mat.sidenav-theme(theme.$rose-theme);
|
||||
@include mat.icon-theme(theme.$rose-theme);
|
||||
@include mat.form-field-theme(theme.$rose-theme);
|
||||
@include mat.list-theme(theme.$rose-theme);
|
||||
@include mat.select-theme(theme.$rose-theme);
|
||||
@include mat.snack-bar-theme(theme.$rose-theme);
|
||||
@include mat.button-toggle-theme(theme.$rose-theme);
|
||||
@include mat.dialog-theme(theme.$rose-theme);
|
||||
@include custom-colours(theme.$rose-theme);
|
||||
color-scheme: dark light;
|
||||
height: 100%;
|
||||
|
||||
@include mat.theme(
|
||||
(
|
||||
color: mat.$rose-palette,
|
||||
typography: Roboto,
|
||||
density: -5,
|
||||
)
|
||||
);
|
||||
@include mat.toolbar-overrides(
|
||||
(
|
||||
container-background-color: var(--mat-sys-primary-container),
|
||||
)
|
||||
);
|
||||
|
||||
@include mat.sidenav-overrides(
|
||||
(
|
||||
container-shape: 1rem,
|
||||
container-background-color: var(--mat-sys-secondary-container),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font: mat.get-theme-typography(theme.$rose-theme, body-medium, font);
|
||||
--mat-tree-node-min-height: 24px;
|
||||
--mat-tree-node-text-size: 14px;
|
||||
--mdc-icon-button-state-layer-size: 24px;
|
||||
--mat-icon-button-touch-target-display: none;
|
||||
--mdc-list-list-item-one-line-container-height: 24px;
|
||||
background: var(--mat-sys-surface);
|
||||
color: var(--mat-sys-on-surface);
|
||||
font-family: Roboto, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
@use "@angular/material" as mat;
|
||||
|
||||
$rose-theme: mat.define-theme(
|
||||
(
|
||||
color: (
|
||||
theme-type: dark,
|
||||
primary: mat.$rose-palette,
|
||||
),
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user