Skip to content

Commit ef2ed10

Browse files
committed
refactor(crm): update styles to work with theming package
1 parent 551d403 commit ef2ed10

1 file changed

Lines changed: 52 additions & 13 deletions

File tree

projects/app-crm/src/app/grid-crm/grid-crm.component.scss

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,63 @@
44
@import url('https://unpkg.com/@fortawesome/fontawesome-free-webfonts@^1.0.9/css/fa-solid.css');
55

66
:host ::ng-deep {
7-
$crm-grid-palette: palette($primary: #09f, $secondary: #ffbf00, $surface: #fff);
8-
$crm-grid-dark-palette: palette($primary: #09f, $secondary: #fff, $surface: #222);
9-
@include theme($crm-grid-palette);
7+
$crm-grid-palette: palette(
8+
$primary: #09f,
9+
$secondary: #ffbf00,
10+
$surface: #fff
11+
);
12+
$crm-grid-dark-palette: palette(
13+
$primary: #09f,
14+
$secondary: #fff,
15+
$surface: #222
16+
);
17+
@include palette($crm-grid-palette);
1018

1119
$checkbox-theme: checkbox-theme(
12-
$fill-color: color($crm-grid-palette, 'secondary', 500),
13-
$tick-color: black
20+
$fill-color: color($color: 'secondary', $variant: 500),
21+
$tick-color: contrast-color($color: 'secondary', $variant: 500)
22+
);
23+
$checkbox-dark-theme: checkbox-theme(
24+
$fill-color: color($color: 'gray', $variant: 900),
25+
$tick-color: contrast-color($color: 'gray', $variant: 900)
26+
);
27+
$summary-theme: grid-summary-theme(
28+
$background-color: #f0f8fe,
29+
$result-color: color($color: 'primary', $variant: 500)
30+
);
31+
$search-theme: input-group-theme(
32+
$search-background: color($color: 'primary', $variant: 600),
33+
$idle-text-color: color($color: 'primary', $variant: 100),
34+
$filled-text-color: color($color: 'gray', $variant: 600),
35+
$focused-text-color: color($color: 'gray', $variant: 600)
36+
);
37+
38+
@debug $search-theme;
39+
40+
$crm-grid-theme: grid-theme(
41+
$header-background: #f0f8fe,
42+
$header-border-color: #dde5eb
1443
);
15-
$checkbox-dark-theme: checkbox-theme($fill-color: color($crm-grid-palette, 'gray', 50), $tick-color: black);
16-
$summary-theme: grid-summary-theme($background-color: #f0f8fe, $result-color: color($crm-grid-palette, 'primary', 500));
17-
$search-theme: input-group-theme($search-background: color($crm-grid-palette, 'primary', 600), $idle-text-color: color($crm-grid-palette, 'primary', 100), $filled-text-color: color($crm-grid-palette, 'gray', 600), $focused-text-color: color($crm-grid-palette, 'gray', 600));
18-
$crm-grid-theme: grid-theme($header-background: #f0f8fe, $header-border-color: #dde5eb);
1944
$crm-dark-grid-theme: grid-theme(
2045
$row-selected-background: color($crm-grid-palette, 'gray', 800),
2146
$row-hover-background: color($crm-grid-palette, 'gray', 700),
2247
$row-selected-hover-background: color($crm-grid-palette, 'gray', 700),
2348
$cell-active-border-color: color($crm-grid-palette, 'primary', 50),
2449
$cell-selected-background: color($crm-grid-palette, 'gray', 50),
2550
);
26-
$crm-grid-toolbar: grid-toolbar-theme($background-color: color($crm-grid-palette, 'primary', 500));
27-
$crm-grid-toolbar-button: button-theme($background: color($crm-grid-palette, 'primary', 800), $hover-background: color($crm-grid-palette, 'primary', 900), $focus-foreground: #fff);
28-
$crm-grid-search-button: button-theme($background: transparent, $focus-background: color($crm-grid-palette, 'gray', 200), $hover-background: color($crm-grid-palette, 'gray', 200));
51+
$crm-grid-toolbar: grid-toolbar-theme(
52+
$background-color: color($crm-grid-palette, 'primary', 500)
53+
);
54+
$crm-grid-toolbar-button: button-theme(
55+
$background: color($crm-grid-palette, 'primary', 800),
56+
$hover-background: color($crm-grid-palette, 'primary', 900),
57+
$focus-foreground: #fff
58+
);
59+
$crm-grid-search-button: button-theme(
60+
$background: transparent,
61+
$focus-background: color($crm-grid-palette, 'gray', 200),
62+
$hover-background: color($crm-grid-palette, 'gray', 200)
63+
);
2964
$crm-grid-dark-button: button-theme(
3065
$foreground: color($crm-grid-dark-palette, 'primary', 500),
3166
$hover-foreground: color($crm-grid-dark-palette, 'primary', 500),
@@ -34,7 +69,10 @@
3469
$crm-grid-dark-progress: progress-linear-theme(
3570
$track-color: color($crm-grid-palette, 'gray', 500)
3671
);
37-
$crm-input-drop-down: input-group-theme($placeholder-color: color($crm-grid-palette, 'gray', 500), $idle-text-color: color($crm-grid-palette, 'gray', 900));
72+
$crm-input-drop-down: input-group-theme(
73+
$placeholder-color: color($crm-grid-palette, 'gray', 500),
74+
$idle-text-color: color($crm-grid-palette, 'gray', 900)
75+
);
3876

3977
.grid__wrapper {
4078
width: inherit;
@@ -295,6 +333,7 @@
295333
.grid__wrapper:not(.dark_grid) {
296334
@include css-vars($crm-grid-theme);
297335
@include css-vars($summary-theme);
336+
@include css-vars($checkbox-theme);
298337
}
299338

300339
.dark_grid {

0 commit comments

Comments
 (0)