Skip to content

Commit 5d88f2c

Browse files
authored
feat(docs): add theme toggle (#5092)
Closes #5065
1 parent 881d96c commit 5d88f2c

31 files changed

+344
-156
lines changed

projects/www/src/_code_theme.scss

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@ pre code.hljs {
77
pre {
88
margin: 14px 0 24px;
99
overflow-x: auto;
10-
border: 1px solid rgba(255, 255, 255, 0.12);
10+
border: 1px solid var(--ngrx-border-color);
1111
}
1212

1313
code.hljs {
1414
padding: 3px 5px;
1515
}
1616

1717
.hljs {
18-
color: #abb2bf;
19-
background: rgba(0, 0, 0, 0.24);
18+
color: var(--ngrx-code-text);
19+
background: var(--ngrx-code-bg);
2020
}
2121
.hljs-comment,
2222
.hljs-quote {
23-
color: #5c6370;
23+
color: var(--ngrx-code-comment);
2424
font-style: italic;
2525
}
2626
.hljs-doctag,
2727
.hljs-keyword,
2828
.hljs-formula {
29-
color: #fface6;
29+
color: var(--ngrx-code-keyword);
3030
}
3131
.hljs-section,
3232
.hljs-name,
3333
.hljs-selector-tag,
3434
.hljs-deletion,
3535
.hljs-subst {
36-
color: #e06c75;
36+
color: var(--ngrx-code-deletion);
3737
}
3838
.hljs-literal {
39-
color: #56b6c2;
39+
color: var(--ngrx-code-literal);
4040
}
4141
.hljs-string,
4242
.hljs-regexp,
4343
.hljs-addition,
4444
.hljs-attribute,
4545
.hljs-meta .hljs-string {
46-
color: #98c379;
46+
color: var(--ngrx-code-string);
4747
}
4848
.hljs-attr,
4949
.hljs-variable,
@@ -53,20 +53,20 @@ code.hljs {
5353
.hljs-selector-attr,
5454
.hljs-selector-pseudo,
5555
.hljs-number {
56-
color: #ffb871;
56+
color: var(--ngrx-code-number);
5757
}
5858
.hljs-symbol,
5959
.hljs-bullet,
6060
.hljs-link,
6161
.hljs-meta,
6262
.hljs-selector-id,
6363
.hljs-title {
64-
color: #61aeee;
64+
color: var(--ngrx-code-title);
6565
}
6666
.hljs-built_in,
6767
.hljs-title.class_,
6868
.hljs-class .hljs-title {
69-
color: #ffdcbe;
69+
color: var(--ngrx-code-class);
7070
}
7171
.hljs-emphasis {
7272
font-style: italic;

projects/www/src/app/components/contributor-card.component.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ import { Contributor } from '../services/contributors.service';
1717
1818
<div class="contributor-links">
1919
@if (contributor().twitter) {
20-
<a
21-
[href]="'https://twitter.com/' + contributor().twitter"
22-
target="_blank"
23-
>
24-
<img src="/images/bios/card-icons/twitter.svg" alt="Twitter" />
25-
</a>
26-
} @if (contributor().website) {
27-
<a [href]="contributor().website" target="_blank">
28-
<img src="/images/bios/card-icons/link.svg" alt="Website" />
29-
</a>
20+
<a
21+
[href]="'https://twitter.com/' + contributor().twitter"
22+
target="_blank"
23+
>
24+
<img src="/images/bios/card-icons/twitter.svg" alt="Twitter" />
25+
</a>
26+
}
27+
@if (contributor().website) {
28+
<a [href]="contributor().website" target="_blank">
29+
<img src="/images/bios/card-icons/link.svg" alt="Website" />
30+
</a>
3031
}
3132
</div>
3233
@@ -59,8 +60,8 @@ import { Contributor } from '../services/contributors.service';
5960
align-items: center;
6061
justify-content: center;
6162
overflow: hidden;
62-
background: #fff;
63-
border-bottom: solid 4px #cf8fc5;
63+
background: var(--ngrx-text);
64+
border-bottom: solid 4px var(--ngrx-accent);
6465
}
6566
.contributor-photo img {
6667
height: 100%;
@@ -72,7 +73,7 @@ import { Contributor } from '../services/contributors.service';
7273
width: 200px;
7374
padding: 15px 0 0;
7475
text-align: center;
75-
background: #120c14;
76+
background: var(--ngrx-bg-overlay);
7677
}
7778
.contributor-info h3 {
7879
margin-top: 0;
@@ -82,14 +83,14 @@ import { Contributor } from '../services/contributors.service';
8283
}
8384
.view-bio {
8485
margin: 10px 0 0;
85-
color: #cf8fc5;
86+
color: var(--ngrx-accent);
8687
font-size: 14px;
8788
cursor: pointer;
88-
background: #221925;
89+
background: var(--ngrx-bg-elevated);
8990
padding: 6px 0;
9091
}
9192
.view-bio:hover {
92-
color: #ececec;
93+
color: var(--ngrx-text);
9394
}
9495
.contributor-links {
9596
display: flex;
@@ -108,8 +109,8 @@ import { Contributor } from '../services/contributors.service';
108109
right: 0;
109110
width: 100%;
110111
height: 100%;
111-
background: #120c14;
112-
color: #fff;
112+
background: var(--ngrx-bg-overlay);
113+
color: var(--ngrx-text);
113114
padding: 15px;
114115
overflow: hidden;
115116
display: flex;
@@ -130,7 +131,7 @@ import { Contributor } from '../services/contributors.service';
130131
}
131132
.contributor-bio-preview p {
132133
margin: 0;
133-
color: #fff;
134+
color: var(--ngrx-text);
134135
font-size: 12px;
135136
line-height: 16px;
136137
}

projects/www/src/app/components/contributor-navigation.component.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ import { GroupNav } from '../services/contributors.service';
66
template: `
77
<div class="groups-navigation">
88
@for (group of groupNames(); track group.name) {
9-
<p
10-
(click)="selectGroup(group.name)"
11-
[class.selected]="selectedGroup() === group.name"
12-
>
13-
{{ group.name }}
14-
</p>
9+
<p
10+
(click)="selectGroup(group.name)"
11+
[class.selected]="selectedGroup() === group.name"
12+
>
13+
{{ group.name }}
14+
</p>
1515
}
1616
</div>
1717
`,
1818
styles: [
1919
`
2020
.groups-navigation {
2121
display: flex;
22-
background: #221925;
22+
background: var(--ngrx-bg-elevated);
2323
width: fit-content;
2424
padding: 5px;
2525
gap: 5px;
@@ -28,16 +28,16 @@ import { GroupNav } from '../services/contributors.service';
2828
border-radius: 5px;
2929
}
3030
.groups-navigation p {
31-
color: #bfbcc0;
31+
color: var(--ngrx-text-muted);
3232
padding: 2px 10px;
3333
cursor: pointer;
3434
margin: 0;
3535
border-radius: 2px;
3636
font-size: 18px;
3737
}
3838
.groups-navigation p.selected {
39-
background: #120c14;
40-
color: #fff;
39+
background: var(--ngrx-bg-overlay);
40+
color: var(--ngrx-text);
4141
}
4242
`,
4343
],

projects/www/src/app/components/docs/alert.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type AlertType = 'inform' | 'warn' | 'error' | 'help';
2222
border-top: 1px solid;
2323
border-bottom: 1px solid;
2424
border-right: 1px solid;
25-
border-color: rgba(255, 255, 255, 0.12);
25+
border-color: var(--ngrx-border-color);
2626
}
2727
2828
:host p {
@@ -45,7 +45,7 @@ export type AlertType = 'inform' | 'warn' | 'error' | 'help';
4545
}
4646
4747
:host(.help) {
48-
border-color: rgba(255, 172, 230, 0.72);
48+
border-color: var(--ngrx-link);
4949
background-color: rgba(255, 172, 230, 0.08);
5050
}
5151

projects/www/src/app/components/docs/code-example.component.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import { ExamplesService } from '@ngrx-io/app/examples/examples.service';
5353
:host {
5454
display: flex;
5555
flex-direction: column;
56-
border: 1px solid rgba(255, 255, 255, 0.12);
56+
border: 1px solid var(--ngrx-border-color);
5757
margin: 14px 0 24px;
5858
}
5959
@@ -64,8 +64,8 @@ import { ExamplesService } from '@ngrx-io/app/examples/examples.service';
6464
6565
.header {
6666
padding: 8px 16px;
67-
background-color: rgba(255, 255, 255, 0.05);
68-
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
67+
background-color: var(--ngrx-bg-elevated);
68+
border-bottom: 1px solid var(--ngrx-border-color);
6969
font-size: 12px;
7070
font-weight: 500;
7171
}
@@ -98,31 +98,31 @@ import { ExamplesService } from '@ngrx-io/app/examples/examples.service';
9898
0% {
9999
background: rgba(207, 143, 197, 0.6);
100100
border-color: rgba(207, 143, 197, 0.4);
101-
color: rgba(255, 255, 255, 1);
101+
color: var(--ngrx-text);
102102
transform: scale(1);
103103
}
104104
15% {
105105
background: rgba(207, 143, 197, 0.6);
106106
border-color: rgba(207, 143, 197, 0.4);
107-
color: rgba(255, 255, 255, 1);
107+
color: var(--ngrx-text);
108108
transform: scale(1.1);
109109
}
110110
30% {
111111
background: rgba(207, 143, 197, 0.6);
112112
border-color: rgba(207, 143, 197, 0.4);
113-
color: rgba(255, 255, 255, 1);
113+
color: var(--ngrx-text);
114114
transform: scale(1);
115115
}
116116
80% {
117117
background: rgba(207, 143, 197, 0.6);
118118
border-color: rgba(207, 143, 197, 0.4);
119-
color: rgba(255, 255, 255, 1);
119+
color: var(--ngrx-text);
120120
transform: scale(1);
121121
}
122122
100% {
123-
background: rgba(0, 0, 0, 0.7);
124-
border-color: rgba(255, 255, 255, 0.2);
125-
color: rgba(255, 255, 255, 0.8);
123+
background: var(--ngrx-bg-elevated);
124+
border-color: var(--ngrx-border-color);
125+
color: var(--ngrx-text-secondary);
126126
transform: scale(1);
127127
}
128128
}

projects/www/src/app/components/docs/markdown-article.component.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type Heading = { level: number; text: string; id: string; url: string };
6969
right: 24px;
7070
margin: 0;
7171
padding: 0;
72-
border-left: 1px solid rgba(255, 255, 255, 0.12);
72+
border-left: 1px solid var(--ngrx-border-color);
7373
@media only screen and (max-width: 1280px) {
7474
position: relative;
7575
width: 100%;
@@ -79,18 +79,18 @@ type Heading = { level: number; text: string; id: string; url: string };
7979
}
8080
8181
menu a {
82-
color: rgba(255, 255, 255, 0.56);
82+
color: var(--ngrx-text-muted);
8383
font-size: 13px;
8484
border-left: 2px solid transparent;
8585
}
8686
8787
menu a:hover {
88-
color: rgba(255, 255, 255, 0.87);
88+
color: var(--ngrx-text-primary);
8989
}
9090
9191
menu a.active {
92-
color: rgba(255, 255, 255, 0.87);
93-
border-color: rgba(207, 143, 197, 0.96);
92+
color: var(--ngrx-text-primary);
93+
border-color: var(--ngrx-accent);
9494
}
9595
9696
.content-menu-holder {
@@ -109,7 +109,7 @@ type Heading = { level: number; text: string; id: string; url: string };
109109
align-items: center;
110110
justify-content: space-between;
111111
padding: 5px 10px;
112-
background: #201a23;
112+
background: var(--ngrx-bg-content-menu);
113113
border-radius: 5px;
114114
display: flex;
115115
margin-bottom: 10px;
@@ -119,7 +119,7 @@ type Heading = { level: number; text: string; id: string; url: string };
119119
display: flex;
120120
}
121121
&:hover {
122-
background: #262029;
122+
background: var(--ngrx-bg-content-menu-hover);
123123
}
124124
}
125125
@@ -153,9 +153,9 @@ type Heading = { level: number; text: string; id: string; url: string };
153153
154154
article ::ng-deep table {
155155
border-collapse: collapse;
156-
border-top: 1px solid rgba(255, 255, 255, 0.12);
157-
border-left: 1px solid rgba(255, 255, 255, 0.12);
158-
border-right: 1px solid rgba(255, 255, 255, 0.12);
156+
border-top: 1px solid var(--ngrx-border-color);
157+
border-left: 1px solid var(--ngrx-border-color);
158+
border-right: 1px solid var(--ngrx-border-color);
159159
margin: 14px 0;
160160
@media only screen and (max-width: 1280px) {
161161
display: block;
@@ -164,12 +164,12 @@ type Heading = { level: number; text: string; id: string; url: string };
164164
}
165165
166166
article ::ng-deep table thead {
167-
background-color: rgba(0, 0, 0, 0.36);
167+
background-color: var(--ngrx-table-header-bg);
168168
font-family: 'Oxanium', sans-serif;
169169
}
170170
171171
article ::ng-deep table tr {
172-
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
172+
border-bottom: 1px solid var(--ngrx-border-color);
173173
}
174174
175175
article ::ng-deep table th,

projects/www/src/app/components/docs/markdown-symbol-link.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { CanonicalReference } from '@ngrx-io/shared';
1111
styles: [
1212
`
1313
ngrx-docs-symbol-link {
14-
color: #ffdcbe;
14+
color: var(--ngrx-link);
1515
}
1616
1717
ngrx-docs-symbol-link a {

projects/www/src/app/components/docs/symbol-api.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { SymbolExcerptGroupComponent } from './symbol-excerpt-group.component';
3434
display: flex;
3535
padding: 8px;
3636
flex-direction: column;
37-
border-top: 1px solid rgba(255, 255, 255, 0.12);
37+
border-top: 1px solid var(--ngrx-border-color);
3838
}
3939
4040
h4 {
@@ -43,7 +43,7 @@ import { SymbolExcerptGroupComponent } from './symbol-excerpt-group.component';
4343
font-weight: 700;
4444
margin: 0;
4545
padding: 8px;
46-
color: #fface6;
46+
color: var(--ngrx-link);
4747
}
4848
4949
.memberExcerpt {

0 commit comments

Comments
 (0)