Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M3 styles #409

Merged
merged 7 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pug/includes/_navbar.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ header
div.search-results.card

div.navbar-fixed
nav
nav.primary
div.nav-wrapper
a.sidenav-trigger(href="#" data-target="nav-mobile")
i.material-icons menu
Expand Down
2 changes: 1 addition & 1 deletion sass/components/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nav {

color: $navbar-font-color;
@extend .z-depth-1;
background-color: $primary-color;
background-color: $secondary-container-color;

width: 100%;
height: $navbar-height-mobile;
Expand Down
6 changes: 3 additions & 3 deletions sass/components/_sidenav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
background-color: $button-flat-focus-background-color;
}

li.active > a:not(.collapsible-header) {
color: $font-on-primary-color-main;
background-color: $primary-color;
li.active > a:not(.collapsible-header):not(.btn):not(.btn-large):not(.btn-small):not(.btn-flat):not(.btn-large):not(.btn-floating) {
color: $font-on-secondary-container-color;
background-color: $secondary-container-color;
}

.collapsible-body > ul { padding-left: 10px; }
Expand Down
73 changes: 27 additions & 46 deletions sass/components/_theme_variables.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
:root, :host {
--surface-color: #f3f6fc;
--background-color: #ffffff;
--surface-color: var(--md-sys-color-surface);
--background-color: var(--md-sys-color-background);

--font-color-main: rgba(0, 0, 0, 0.87);
--font-color-medium: rgba(0, 0, 0, 0.56);
--font-color-disabled: rgba(0, 0, 0, 0.38);
--font-color-main: var(--md-sys-color-on-background);
--font-color-medium: var(--md-sys-color-on-surface-variant);
--font-color-disabled: var(--md-sys-color-on-surface);

--font-on-primary-color-main: rgba(255, 255, 255, 0.87);
--font-on-primary-color-dark-main: rgba(255, 255, 255, 0.87);
--font-on-primary-color-dark-medium: rgba(255, 255, 255, 0.60);
--font-on-primary-color-medium: rgba(255, 255, 255, 0.60);
--font-on-primary-color-main: var(--md-sys-color-on-primary);
--font-on-primary-color-dark-main: var(--md-sys-color-on-primary-dark);
--font-on-primary-color-dark-medium: var(--md-sys-color-on-surface-variant-dark);
--font-on-primary-color-medium: var(--md-sys-color-on-surface-variant);
--font-on-primary-color-disabled: rgba(255, 255, 255, 0.38);
--font-on-secondary-color-main: rgba(0, 0, 0, 0.87);
--font-on-secondary-color-main: var(--md-sys-color-on-secondary);

--hover-color: rgba(0, 0, 0, 0.04);
--focus-color: rgba(0, 0, 0, 0.12);
Expand All @@ -20,7 +20,7 @@
--background-color-disabled: rgba(0, 0, 0, 0.12);
--background-color-level-4dp: rgba(0, 0, 0, 0.09);
--background-color-level-16dp-solid: var(--surface-color);
--background-color-slight-emphasis: rgba(0, 0, 0, 0.025); /* stripes in table */
--background-color-slight-emphasis: rgba(0, 0, 0, 0.08);
--background-color-card: var(--surface-color);

--tooltip-background-color: #313033;
Expand All @@ -30,41 +30,32 @@

--error-color: #F44336;

--slider-track-color: rgba(0, 0, 0, 0.26);
--switch-thumb-off-color: #ffffff;
--slider-track-color: var(--md-sys-color-shadow-light);
--switch-thumb-off-color: var(--md-ref-palette-primary100);

--carousel-indicator-color: rgba(255, 255, 255, 0.45);
--carousel-indicator-active-color: #FFF;
--carousel-indicator-active-color: var(--md-ref-palette-primary100);

--primary-color: #26a69a;
--primary-color-dark: #009688;
--primary-color-numeric: 38, 166, 154;
--primary-color-raised-hover-solid: #30B0A4;
--primary-color-raised-focus-solid: #44C4B8;
--primary-color: var(--md-sys-color-primary);
--primary-color-dark: var(--md-sys-color-primary-dark);
--primary-color-raised-hover-solid: var(--md-ref-palette-primary70);
--primary-color-raised-focus-solid: var(--md-ref-palette-primary80);
--primary-color-font-medium-color: rgba(var(--primary-color-numeric), 0.7);
--primary-color-font-disabled-color: rgba(var(--primary-color-numeric), 0.4);
--primary-color-hover-opaque: rgba(var(--primary-color-numeric), 0.06);
--primary-color-focus-opaque: rgba(var(--primary-color-numeric), 0.18);

--secondary-color: #EF5350;
--secondary-color-hover-solid: #FE625F;
--secondary-color-focus-solid: #FF7B78;
--secondary-color: var(--md-sys-color-secondary);
--secondary-color-hover-solid: var(--md-ref-palette-secondary70);
--secondary-color-focus-solid: var(--md-ref-palette-secondary80);
--secondary-container-color: var(--md-sys-color-secondary-container);
--font-on-secondary-container-color: var(--md-sys-color-on-secondary-container);

--md_sys_color_on-surface: 28, 27, 31;
}

:root[theme='dark'], :host[theme='dark'] {
--background-color: #121212;
--surface-color: #242424;

--font-color-main: rgba(255, 255, 255, 0.87);
--font-color-medium: rgba(255, 255, 255, 0.60);
--font-color-disabled: rgba(255, 255, 255, 0.38);

--font-on-primary-color-main: rgba(0, 0, 0, 0.87);
--font-on-primary-color-dark-main: rgba(255, 255, 255, 0.87);
--font-on-primary-color-dark-medium: rgba(255, 255, 255, 0.60);
--font-on-primary-color-medium: rgba(0, 0, 0, 0.56);
//important: when all variables are assigned this could be removed as will be no difference
:root[theme='dark'] {
--font-on-primary-color-disabled: rgba(0, 0, 0, 0.38);

--hover-color: rgba(255, 255, 255, 0.04);
Expand All @@ -74,25 +65,15 @@
--background-color-disabled: rgba(255, 255, 255, 0.12);
--background-color-level-4dp: rgba(255, 255, 255, 0.09);
--background-color-level-16dp-solid: #262626;
--background-color-card: var(--surface-color);
--background-color-slight-emphasis: rgba(255, 255, 255, 0.05);

--separator-color: #424242; /* borders between components */

--error-color: #CF6679;

--slider-track-color: rgba(255, 255, 255, 0.26);
--switch-thumb-off-color: #bababa;

--primary-color: #B39DDB;
--primary-color-dark: #9575CD;
--primary-color-numeric: 179, 157, 219;
--primary-color-raised-hover-solid: #C2ACEA;
--primary-color-raised-focus-solid: #DBC5FF;
--md_sys_color_on-surface: 230, 225, 229;
}

--secondary-color: #CDDC39;
--secondary-color-hover-solid: #DCEB48;
--secondary-color-focus-solid: #F5FF61;

--md_sys_color_on-surface: 230, 225, 229;
}
2 changes: 2 additions & 0 deletions sass/components/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ $font-on-secondary-color-main: var(--font-on-secondary-color-main) !default;
$secondary-color: var(--secondary-color) !default;
$secondary-color-when-hovered-solid: var(--secondary-color-hover-solid) !default;
$secondary-color-when-focused-solid: var(--secondary-color-focus-solid) !default;
$secondary-container-color: var(--secondary-container-color) !default;
$font-on-secondary-container-color: var(--font-on-secondary-container-color) !default;

$success-color: color("green", "base") !default;
$error-color: var(--error-color) !default;
Expand Down
180 changes: 180 additions & 0 deletions sass/components/colors.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
.primary {
background-color: var(--md-sys-color-primary);
}
.primary-text {
color: var(--md-sys-color-primary);
}
.on-primary {
background-color: var(--md-sys-color-on-primary);
}
.on-primary-text {
color: var(--md-sys-color-on-primary);
}
.primary-container {
background-color: var(--md-sys-color-primary-container);
}
.primary-container-text {
color: var(--md-sys-color-primary-container);
}
.on-primary-container {
background-color: var(--md-sys-color-on-primary-container);
}
.on-primary-container-text {
color: var(--md-sys-color-on-primary-container);
}
.secondary {
background-color: var(--md-sys-color-secondary);
}
.secondary-text {
color: var(--md-sys-color-secondary);
}
.on-secondary {
background-color: var(--md-sys-color-on-secondary);
}
.on-secondary-text {
color: var(--md-sys-color-on-secondary);
}
.secondary-container {
background-color: var(--md-sys-color-secondary-container);
}
.secondary-container-text {
color: var(--md-sys-color-secondary-container);
}
.on-secondary-container {
background-color: var(--md-sys-color-on-secondary-container);
}
.on-secondary-container-text {
color: var(--md-sys-color-on-secondary-container);
}
.tertiary {
background-color: var(--md-sys-color-tertiary);
}
.tertiary-text {
color: var(--md-sys-color-tertiary);
}
.on-tertiary {
background-color: var(--md-sys-color-on-tertiary);
}
.on-tertiary-text {
color: var(--md-sys-color-on-tertiary);
}
.tertiary-container {
background-color: var(--md-sys-color-tertiary-container);
}
.tertiary-container-text {
color: var(--md-sys-color-tertiary-container);
}
.on-tertiary-container {
background-color: var(--md-sys-color-on-tertiary-container);
}
.on-tertiary-container-text {
color: var(--md-sys-color-on-tertiary-container);
}
.error {
background-color: var(--md-sys-color-error);
}
.error-text {
color: var(--md-sys-color-error);
}
.on-error {
background-color: var(--md-sys-color-on-error);
}
.on-error-text {
color: var(--md-sys-color-on-error);
}
.error-container {
background-color: var(--md-sys-color-error-container);
}
.error-container-text {
color: var(--md-sys-color-error-container);
}
.on-error-container {
background-color: var(--md-sys-color-on-error-container);
}
.on-error-container-text {
color: var(--md-sys-color-on-error-container);
}
.background {
background-color: var(--md-sys-color-background);
}
.background-text {
color: var(--md-sys-color-background);
}
.on-background {
background-color: var(--md-sys-color-on-background);
}
.on-background-text {
color: var(--md-sys-color-on-background);
}
.surface {
background-color: var(--md-sys-color-surface);
}
.surface-text {
color: var(--md-sys-color-surface);
}
.on-surface {
background-color: var(--md-sys-color-on-surface);
}
.on-surface-text {
color: var(--md-sys-color-on-surface);
}
.surface-variant {
background-color: var(--md-sys-color-surface-variant);
}
.surface-variant-text {
color: var(--md-sys-color-surface-variant);
}
.on-surface-variant {
background-color: var(--md-sys-color-on-surface-variant);
}
.on-surface-variant-text {
color: var(--md-sys-color-on-surface-variant);
}
.outline {
background-color: var(--md-sys-color-outline);
}
.outline-text {
color: var(--md-sys-color-outline);
}
.inverse-on-surface {
background-color: var(--md-sys-color-inverse-on-surface);
}
.inverse-on-surface-text {
color: var(--md-sys-color-inverse-on-surface);
}
.inverse-surface {
background-color: var(--md-sys-color-inverse-surface);
}
.inverse-surface-text {
color: var(--md-sys-color-inverse-surface);
}
.inverse-primary {
background-color: var(--md-sys-color-inverse-primary);
}
.inverse-primary-text {
color: var(--md-sys-color-inverse-primary);
}
.shadow {
background-color: var(--md-sys-color-shadow);
}
.shadow-text {
color: var(--md-sys-color-shadow);
}
.surface-tint {
background-color: var(--md-sys-color-surface-tint);
}
.surface-tint-text {
color: var(--md-sys-color-surface-tint);
}
.outline-variant {
background-color: var(--md-sys-color-outline-variant);
}
.outline-variant-text {
color: var(--md-sys-color-outline-variant);
}
.scrim {
background-color: var(--md-sys-color-scrim);
}
.scrim-text {
color: var(--md-sys-color-scrim);
}
32 changes: 32 additions & 0 deletions sass/components/theme.dark.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:root[theme='dark'] {
--md-sys-color-primary: var(--md-sys-color-primary-dark);
--md-sys-color-on-primary: var(--md-sys-color-on-primary-dark);
--md-sys-color-primary-container: var(--md-sys-color-primary-container-dark);
--md-sys-color-on-primary-container: var(--md-sys-color-on-primary-container-dark);
--md-sys-color-secondary: var(--md-sys-color-secondary-dark);
--md-sys-color-on-secondary: var(--md-sys-color-on-secondary-dark);
--md-sys-color-secondary-container: var(--md-sys-color-secondary-container-dark);
--md-sys-color-on-secondary-container: var(--md-sys-color-on-secondary-container-dark);
--md-sys-color-tertiary: var(--md-sys-color-tertiary-dark);
--md-sys-color-on-tertiary: var(--md-sys-color-on-tertiary-dark);
--md-sys-color-tertiary-container: var(--md-sys-color-tertiary-container-dark);
--md-sys-color-on-tertiary-container: var(--md-sys-color-on-tertiary-container-dark);
--md-sys-color-error: var(--md-sys-color-error-dark);
--md-sys-color-on-error: var(--md-sys-color-on-error-dark);
--md-sys-color-error-container: var(--md-sys-color-error-container-dark);
--md-sys-color-on-error-container: var(--md-sys-color-on-error-container-dark);
--md-sys-color-outline: var(--md-sys-color-outline-dark);
--md-sys-color-background: var(--md-sys-color-background-dark);
--md-sys-color-on-background: var(--md-sys-color-on-background-dark);
--md-sys-color-surface: var(--md-sys-color-surface-dark);
--md-sys-color-on-surface: var(--md-sys-color-on-surface-dark);
--md-sys-color-surface-variant: var(--md-sys-color-surface-variant-dark);
--md-sys-color-on-surface-variant: var(--md-sys-color-on-surface-variant-dark);
--md-sys-color-inverse-surface: var(--md-sys-color-inverse-surface-dark);
--md-sys-color-inverse-on-surface: var(--md-sys-color-inverse-on-surface-dark);
--md-sys-color-inverse-primary: var(--md-sys-color-inverse-primary-dark);
--md-sys-color-shadow: var(--md-sys-color-shadow-dark);
--md-sys-color-surface-tint: var(--md-sys-color-surface-tint-dark);
--md-sys-color-outline-variant: var(--md-sys-color-outline-variant-dark);
--md-sys-color-scrim: var(--md-sys-color-scrim-dark);
}
Loading
Loading