2019-08-08 19:39:06 +03:00
|
|
|
/**
|
2021-01-11 13:42:16 +02:00
|
|
|
* Copyright © 2016-2021 The Thingsboard Authors
|
2019-08-08 19:39:06 +03:00
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
2021-11-30 09:57:35 +02:00
|
|
|
@use '~@angular/material' as mat;
|
2019-08-08 19:39:06 +03:00
|
|
|
@import '~@mat-datetimepicker/core/datetimepicker/datetimepicker-theme.scss';
|
|
|
|
|
@import './scss/constants';
|
|
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
@include mat.core();
|
2019-08-08 19:39:06 +03:00
|
|
|
|
|
|
|
|
$tb-primary-color: #305680;
|
|
|
|
|
$tb-secondary-color: #527dad;
|
|
|
|
|
$tb-hue3-color: #a7c1de;
|
|
|
|
|
|
|
|
|
|
$tb-dark-primary-color: #9fa8da;
|
|
|
|
|
|
|
|
|
|
$tb-mat-indigo: (
|
|
|
|
|
50: #e8eaf6,
|
|
|
|
|
100: #c5cae9,
|
|
|
|
|
200: #9fa8da,
|
|
|
|
|
300: #7986cb,
|
|
|
|
|
400: #5c6bc0,
|
|
|
|
|
500: $tb-primary-color,
|
|
|
|
|
600: $tb-secondary-color,
|
|
|
|
|
700: #303f9f,
|
|
|
|
|
800: #283593,
|
|
|
|
|
900: #1a237e,
|
|
|
|
|
A100: $tb-hue3-color,
|
|
|
|
|
A200: #536dfe,
|
|
|
|
|
A400: #3d5afe,
|
|
|
|
|
A700: #304ffe,
|
|
|
|
|
contrast: (
|
2021-11-30 09:57:35 +02:00
|
|
|
50: rgba(black, 0.87),
|
|
|
|
|
100: rgba(black, 0.87),
|
|
|
|
|
200: rgba(black, 0.87),
|
|
|
|
|
300: white,
|
|
|
|
|
400: white,
|
|
|
|
|
500: white,
|
|
|
|
|
600: white,
|
|
|
|
|
700: white,
|
|
|
|
|
800: white,
|
|
|
|
|
900: white,
|
|
|
|
|
A100: rgba(black, 0.87),
|
|
|
|
|
A200: white,
|
|
|
|
|
A400: white,
|
|
|
|
|
A700: white,
|
2019-08-08 19:39:06 +03:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
$tb-primary: mat.define-palette($tb-mat-indigo);
|
|
|
|
|
$tb-accent: mat.define-palette(mat.$deep-orange-palette);
|
2019-08-08 19:39:06 +03:00
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
$background: (background: map_get(mat.$grey-palette, 200));
|
2019-08-08 19:39:06 +03:00
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
$tb-theme-background: map_merge(mat.$light-theme-background-palette, $background);
|
2019-08-08 19:39:06 +03:00
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
$tb-mat-theme: mat.define-light-theme(
|
2019-08-08 19:39:06 +03:00
|
|
|
$tb-primary,
|
|
|
|
|
$tb-accent
|
|
|
|
|
);
|
|
|
|
|
|
2020-03-26 16:59:36 +02:00
|
|
|
$tb-theme: map_merge($tb-mat-theme, (background: $tb-theme-background));
|
|
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
$primary: mat.get-color-from-palette($tb-primary);
|
|
|
|
|
$accent: mat.get-color-from-palette($tb-accent);
|
2019-08-08 19:39:06 +03:00
|
|
|
|
|
|
|
|
$tb-dark-mat-indigo: (
|
|
|
|
|
50: #e8eaf6,
|
|
|
|
|
100: #c5cae9,
|
|
|
|
|
200: #9fa8da,
|
|
|
|
|
300: #7986cb,
|
|
|
|
|
400: #5c6bc0,
|
|
|
|
|
500: $tb-dark-primary-color,
|
|
|
|
|
600: $tb-secondary-color,
|
|
|
|
|
700: #303f9f,
|
2019-08-09 19:13:18 +03:00
|
|
|
800: $tb-primary-color,
|
2019-08-08 19:39:06 +03:00
|
|
|
900: #1a237e,
|
|
|
|
|
A100: $tb-hue3-color,
|
|
|
|
|
A200: #536dfe,
|
|
|
|
|
A400: #3d5afe,
|
|
|
|
|
A700: #304ffe,
|
|
|
|
|
contrast: (
|
2021-11-30 09:57:35 +02:00
|
|
|
50: rgba(black, 0.87),
|
|
|
|
|
100: rgba(black, 0.87),
|
|
|
|
|
200: rgba(black, 0.87),
|
|
|
|
|
300: rgba(black, 0.87),
|
|
|
|
|
400: rgba(black, 0.87),
|
2019-08-08 19:39:06 +03:00
|
|
|
500: map_get($tb-mat-indigo, 900),
|
2021-11-30 09:57:35 +02:00
|
|
|
600: white,
|
|
|
|
|
700: white,
|
|
|
|
|
800: white,
|
|
|
|
|
900: white,
|
|
|
|
|
A100: rgba(black, 0.87),
|
|
|
|
|
A200: rgba(black, 0.87),
|
|
|
|
|
A400: rgba(black, 0.87),
|
|
|
|
|
A700: rgba(black, 0.87),
|
2019-08-08 19:39:06 +03:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
$tb-dark-primary: mat.define-palette($tb-dark-mat-indigo);
|
2019-08-08 19:39:06 +03:00
|
|
|
|
|
|
|
|
$tb-dark-theme-background: (
|
|
|
|
|
status-bar: black,
|
2019-08-09 19:13:18 +03:00
|
|
|
app-bar: map_get($tb-dark-mat-indigo, 900),
|
|
|
|
|
background: map_get($tb-dark-mat-indigo, 800),
|
2019-08-08 19:39:06 +03:00
|
|
|
hover: rgba(white, 0.04),
|
2019-08-09 19:13:18 +03:00
|
|
|
card: map_get($tb-dark-mat-indigo, 800),
|
|
|
|
|
dialog: map_get($tb-dark-mat-indigo, 800),
|
2019-08-08 19:39:06 +03:00
|
|
|
disabled-button: rgba(white, 0.12),
|
2019-08-09 19:13:18 +03:00
|
|
|
raised-button: map-get($tb-dark-mat-indigo, 50),
|
2021-11-30 09:57:35 +02:00
|
|
|
focused-button: rgba(white, 0.12),
|
2019-08-09 19:13:18 +03:00
|
|
|
selected-button: map_get($tb-dark-mat-indigo, 900),
|
|
|
|
|
selected-disabled-button: map_get($tb-dark-mat-indigo, 800),
|
2019-08-08 19:39:06 +03:00
|
|
|
disabled-button-toggle: black,
|
2019-08-09 19:13:18 +03:00
|
|
|
unselected-chip: map_get($tb-dark-mat-indigo, 700),
|
2019-08-08 19:39:06 +03:00
|
|
|
disabled-list-option: black,
|
2021-11-30 09:57:35 +02:00
|
|
|
tooltip: map_get(mat.$grey-palette, 700),
|
2019-08-08 19:39:06 +03:00
|
|
|
);
|
|
|
|
|
|
2021-11-30 09:57:35 +02:00
|
|
|
@function get-tb-dark-theme($primary, $accent, $warn: mat.define-palette(mat.$red-palette)) {
|
2019-08-08 19:39:06 +03:00
|
|
|
@return (
|
|
|
|
|
primary: $primary,
|
|
|
|
|
accent: $accent,
|
|
|
|
|
warn: $warn,
|
|
|
|
|
is-dark: true,
|
2021-11-30 09:57:35 +02:00
|
|
|
foreground: mat.$dark-theme-foreground-palette,
|
2019-08-08 19:39:06 +03:00
|
|
|
background: $tb-dark-theme-background,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tb-dark-theme: get-tb-dark-theme(
|
|
|
|
|
$tb-dark-primary,
|
|
|
|
|
$tb-accent
|
|
|
|
|
);
|
|
|
|
|
|
2019-09-19 20:10:52 +03:00
|
|
|
@mixin mat-fab-toolbar-theme($theme) {
|
|
|
|
|
$primary: map-get($theme, primary);
|
|
|
|
|
$accent: map-get($theme, accent);
|
|
|
|
|
$warn: map-get($theme, warn);
|
|
|
|
|
$background: map-get($theme, background);
|
|
|
|
|
$foreground: map-get($theme, foreground);
|
|
|
|
|
|
|
|
|
|
mat-fab-toolbar {
|
|
|
|
|
.mat-fab-toolbar-background {
|
2021-11-30 09:57:35 +02:00
|
|
|
background: mat.get-color-from-palette($background, app-bar);
|
|
|
|
|
color: mat.get-color-from-palette($foreground, text);
|
2019-09-19 20:10:52 +03:00
|
|
|
}
|
|
|
|
|
&.mat-primary {
|
|
|
|
|
.mat-fab-toolbar-background {
|
|
|
|
|
@include _mat-toolbar-color($primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
&.mat-accent {
|
|
|
|
|
.mat-fab-toolbar-background {
|
|
|
|
|
@include _mat-toolbar-color($accent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
&.mat-warn {
|
|
|
|
|
.mat-fab-toolbar-background {
|
|
|
|
|
@include _mat-toolbar-color($warn);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-03 18:54:09 +03:00
|
|
|
@mixin _mat-toolbar-inverse-color($palette) {
|
2021-11-30 09:57:35 +02:00
|
|
|
background: mat.get-color-from-palette($palette, default-contrast);
|
|
|
|
|
color: rgba(black, 0.87);
|
2021-06-03 18:54:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@mixin mat-fab-toolbar-inverse-theme($theme) {
|
|
|
|
|
$primary: map-get($theme, primary);
|
|
|
|
|
$accent: map-get($theme, accent);
|
|
|
|
|
$warn: map-get($theme, warn);
|
|
|
|
|
$background: map-get($theme, foreground);
|
|
|
|
|
$foreground: map-get($theme, background);
|
|
|
|
|
|
|
|
|
|
mat-fab-toolbar {
|
|
|
|
|
.mat-fab-toolbar-background {
|
2021-11-30 09:57:35 +02:00
|
|
|
background: mat.get-color-from-palette($background, app-bar);
|
|
|
|
|
color: mat.get-color-from-palette($foreground, text);
|
2021-06-03 18:54:09 +03:00
|
|
|
}
|
|
|
|
|
&.mat-primary {
|
|
|
|
|
.mat-fab-toolbar-background {
|
|
|
|
|
@include _mat-toolbar-inverse-color($primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mat-toolbar {
|
|
|
|
|
&.mat-primary {
|
|
|
|
|
@include _mat-toolbar-inverse-color($primary);
|
|
|
|
|
button.mat-icon-button {
|
|
|
|
|
mat-icon {
|
2021-11-30 09:57:35 +02:00
|
|
|
color: mat.get-color-from-palette($primary);
|
2021-06-03 18:54:09 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.mat-fab {
|
|
|
|
|
&.mat-primary {
|
2021-11-30 09:57:35 +02:00
|
|
|
background: mat.get-color-from-palette($primary, default-contrast);
|
|
|
|
|
color: mat.get-color-from-palette($primary);
|
2021-06-03 18:54:09 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-19 20:10:52 +03:00
|
|
|
@mixin tb-components-theme($theme) {
|
|
|
|
|
$primary: map-get($theme, primary);
|
|
|
|
|
|
|
|
|
|
mat-toolbar{
|
|
|
|
|
&.mat-hue-3 {
|
2021-11-30 09:57:35 +02:00
|
|
|
background-color: mat.get-color-from-palette($primary, 'A100');
|
2019-09-19 20:10:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@include mat-fab-toolbar-theme($tb-theme);
|
2021-06-03 18:54:09 +03:00
|
|
|
|
|
|
|
|
div.tb-dashboard-page.mobile-app {
|
|
|
|
|
@include mat-fab-toolbar-inverse-theme($tb-theme);
|
|
|
|
|
}
|
2019-09-19 20:10:52 +03:00
|
|
|
}
|
|
|
|
|
|
2019-08-08 19:39:06 +03:00
|
|
|
.tb-default {
|
2021-11-30 09:57:35 +02:00
|
|
|
@include mat.all-component-themes($tb-theme);
|
2019-08-08 19:39:06 +03:00
|
|
|
@include mat-datetimepicker-theme($tb-theme);
|
2019-09-19 20:10:52 +03:00
|
|
|
@include tb-components-theme($tb-theme);
|
2019-08-08 19:39:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tb-dark {
|
2021-11-30 09:57:35 +02:00
|
|
|
@include mat.all-component-themes($tb-dark-theme);
|
2019-08-08 19:39:06 +03:00
|
|
|
}
|
2021-06-03 18:54:09 +03:00
|
|
|
|