Skip to content

Commit

Permalink
Inline theme.scss to avoid deps issue downstream (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen authored Jun 10, 2024
1 parent 2b24618 commit 3822f9f
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 167 deletions.
8 changes: 0 additions & 8 deletions mesop/web/src/app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ sass_library(
],
)

sass_library(
name = "theme",
srcs = [
"_theme.scss",
],
)

sass_external_binary(
name = "styles",
src = "styles.scss",
Expand All @@ -36,6 +29,5 @@ sass_external_binary(
sourcemap = False,
deps = [
":normalize",
":theme",
],
)
156 changes: 0 additions & 156 deletions mesop/web/src/app/_theme.scss

This file was deleted.

157 changes: 154 additions & 3 deletions mesop/web/src/app/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,169 @@

@use 'sass:map';
@use 'external/npm/node_modules/@angular/material/index' as mat;
@use 'theme' as theme;

// Normalize as it's expected by Angular:
// https://github.com/angular/components/issues/12133
@import 'normalize';

$_palettes: (
primary: (
0: #000000,
10: #001e31,
20: #00317b,
25: #003f9c,
30: #004cbe,
35: #0052ce,
40: #0064ff,
50: #0077ff,
60: #008cff,
70: #009cff,
80: #87d0ff,
90: #b9e1ff,
95: #e7f2ff,
98: #f7f9ff,
99: #fcfcff,
100: #ffffff,
),
secondary: (
0: #000000,
10: #171a2c,
20: #2c2f42,
25: #373a4d,
30: #434659,
35: #4e5165,
40: #5a5d72,
50: #73768b,
60: #8d8fa6,
70: #a7aac1,
80: #c3c5dd,
90: #dfe1f9,
95: #f0efff,
98: #fbf8ff,
99: #fefbff,
100: #ffffff,
),
tertiary: (
0: #000000,
10: #00201c,
20: #003731,
25: #00443c,
30: #005048,
35: #005d53,
40: #01796b,
50: #008678,
60: #00a392,
70: #2dbfad,
80: #54dbc8,
90: #74f8e4,
95: #b4fff1,
98: #e5fff8,
99: #f2fffb,
100: #ffffff,
),
neutral: (
0: #000000,
10: #1b1b1f,
20: #303034,
25: #3b3b3f,
30: #47464a,
35: #535256,
40: #5f5e62,
50: #78767a,
60: #919094,
70: #acaaaf,
80: #c8c6ca,
90: #e4e1e6,
95: #f3f0f4,
98: #fbf8fd,
99: #fefbff,
100: #ffffff,
4: #0e0e11,
6: #131316,
12: #1f1f23,
17: #2a2a2d,
22: #353438,
24: #39393c,
87: #dcd9de,
92: #eae7ec,
94: #f0edf1,
96: #f5f2f7,
),
neutral-variant: (
0: #000000,
10: #1a1b23,
20: #2f3038,
25: #3a3b43,
30: #46464f,
35: #51525b,
40: #5d5e67,
50: #767680,
60: #90909a,
70: #abaab4,
80: #c6c5d0,
90: #e3e1ec,
95: #f1effa,
98: #fbf8ff,
99: #fefbff,
100: #ffffff,
),
error: (
0: #000000,
10: #410002,
20: #690005,
25: #7e0007,
30: #93000a,
35: #a80710,
40: #ba1a1a,
50: #de3730,
60: #ff5449,
70: #ff897d,
80: #ffb4ab,
90: #ffdad6,
95: #ffedea,
98: #fff8f7,
99: #fffbff,
100: #ffffff,
),
);

$_rest: (
secondary: map.get($_palettes, secondary),
neutral: map.get($_palettes, neutral),
neutral-variant: map.get($_palettes, neutral-variant),
error: map.get($_palettes, error),
);
$_primary: map.merge(map.get($_palettes, primary), $_rest);
$_tertiary: map.merge(map.get($_palettes, tertiary), $_rest);

$primary: $_primary;
$tertiary: $_tertiary;

$light-theme: mat.define-theme(
(
color: (
theme-type: light,
primary: $_primary,
tertiary: $_tertiary,
),
)
);
$dark-theme: mat.define-theme(
(
color: (
theme-type: dark,
primary: $_primary,
tertiary: $_tertiary,
),
)
);

@include mat.all-component-typographies();
@include mat.core();

body {
@include mat.all-component-themes(theme.$light-theme);
@include mat.color-variants-backwards-compatibility(theme.$light-theme);
@include mat.all-component-themes($light-theme);
@include mat.color-variants-backwards-compatibility($light-theme);
}

html,
Expand Down

0 comments on commit 3822f9f

Please sign in to comment.