Skip to content

Commit c70836b

Browse files
author
Mike Nguyen
committed
styling: theme
1 parent 34d26f1 commit c70836b

File tree

3 files changed

+101
-1
lines changed

3 files changed

+101
-1
lines changed

angular.json

+3
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,8 @@
103103
}
104104
}
105105
}
106+
},
107+
"cli": {
108+
"analytics": false
106109
}
107110
}

src/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export class AppComponent implements OnInit, AfterViewInit {
436436
.subscribe({
437437
next: ({ node, status }) => {
438438
this.nodesSvg.update((v) => {
439-
const nodeIdx = v.findIndex((it) => it.val === node.val);
439+
const nodeIdx = v.findIndex((it) => it.x === node.x && it.y === node.y);
440440
v[nodeIdx] = { ...v[nodeIdx], status };
441441
return [...v];
442442
});

src/styles.scss

+97
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,100 @@
1+
// Custom Theming for Angular Material
2+
// For more information: https://material.angular.io/guide/theming
3+
@use "@angular/material" as mat;
4+
// Plus imports for other components in your app.
5+
6+
// Include the common styles for Angular Material. We include this here so that you only
7+
// have to load a single css file for Angular Material in your app.
8+
// Be sure that you only ever include this mixin once!
9+
@include mat.core();
10+
11+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700&display=swap");
12+
@import url("https://api.fontshare.com/v2/css?f[]=satoshi@900,700,500,300,400&display=swap");
13+
// Define the palettes for your theme using the Material Design palettes available in palette.scss
14+
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
15+
// hue. Available color palettes: https://material.io/design/color/
16+
17+
$primary: #00599d;
18+
$secondary: #29aae2;
19+
20+
:root {
21+
--color-primary: #00599d;
22+
--custom-color-grey: #dbd8e3;
23+
--color-success: #34bfa3;
24+
--color-danger: #f4516c;
25+
--color-warning: #ffc107;
26+
--color-info: #29aae2;
27+
}
28+
29+
// TODO: Config bootstrap color to make sure text-primary can use same primary color
30+
31+
$people-palette: (
32+
50: #e1f5fe,
33+
100: #b3e6fc,
34+
200: #82d5fb,
35+
300: #50c5f8,
36+
400: #2ab8f8,
37+
500: #03abf6,
38+
600: #039de7,
39+
700: #018ad3,
40+
800: #0179bf,
41+
900: #00599d,
42+
A100: #29aae2,
43+
A200: #29aae2,
44+
A400: #29aae2,
45+
A700: #29aae2,
46+
contrast: (
47+
50: #000000,
48+
100: #000000,
49+
200: #000000,
50+
300: #ffffff,
51+
400: #ffffff,
52+
500: #ffffff,
53+
600: #ffffff,
54+
700: #ffffff,
55+
800: #ffffff,
56+
900: #ffffff,
57+
A100: #000000,
58+
A200: #ffffff,
59+
A400: #ffffff,
60+
A700: #ffffff,
61+
),
62+
);
63+
64+
$people-primary: mat.define-palette($people-palette, 900);
65+
$people-accent: mat.define-palette(
66+
$people-palette,
67+
A100,
68+
);
69+
70+
// The warn palette is optional (defaults to red).
71+
$people-warn: mat.define-palette(mat.$red-palette);
72+
73+
$my-typography: mat.define-typography-config(
74+
$font-family: '"Satoshi", sans-serif',
75+
$button: mat.define-typography-level(0.8rem, 500, $letter-spacing: normal),
76+
$body-1: mat.define-typography-level(1rem, $letter-spacing: normal),
77+
);
78+
79+
// Create the theme object. A theme consists of configurations for individual
80+
// theming systems such as "color" or "typography".
81+
$people-theme: mat.define-light-theme(
82+
(
83+
color: (
84+
primary: $people-primary,
85+
accent: $people-accent,
86+
warn: $people-warn,
87+
),
88+
typography: $my-typography,
89+
)
90+
);
91+
92+
// Include theme styles for core and each component used in your app.
93+
// Alternatively, you can import and @include the theme mixins for each component
94+
// that you are using.
95+
@include mat.all-component-themes($people-theme);
96+
97+
198
/* You can add global styles to this file, and also import other style files */
299
body {
3100
background-color: rgba(233,232,249,.64);

0 commit comments

Comments
 (0)