Skip to content

Commit a8ddb04

Browse files
DDonochVAdokolyski
authored andcommitted
feat: enable light mode
1 parent 9d450d0 commit a8ddb04

File tree

8 files changed

+29
-12
lines changed

8 files changed

+29
-12
lines changed

libs/blog/articles/ui-article-card/src/lib/components/article-regular-card/article-regular-card.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
[priority]="imagePriority()"
2424
size="32"
2525
/>
26-
<span class="text-sm/[14px] font-medium">
26+
<span class="text-al-primary-foreground text-sm/[14px] font-medium">
2727
{{ article().author.name }}
2828
</span>
2929
</div>
@@ -39,7 +39,7 @@
3939
</div>
4040
<div class="flex flex-col gap-3 px-4 pb-4 pt-3">
4141
<h3
42-
class="*:text-al-pink text-2xl font-bold *:not-italic"
42+
class="*:text-al-primary-foreground text-2xl font-bold *:not-italic"
4343
[id]="article().slug"
4444
[innerHTML]="sanitizedArticle().title"
4545
style="word-break: break-word"

libs/blog/articles/ui-article-list-title/src/lib/ui-article-list-title/ui-article-list-title.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="my-5 flex flex-row items-center justify-between gap-6">
22
<h2
33
data-testId="article-list-title"
4-
class="line-clamp-2 max-w-[160px] text-xl font-bold md:line-clamp-1 md:max-w-full lg:text-3xl"
4+
class="text-al-primary-foreground line-clamp-2 max-w-[160px] text-xl font-bold md:line-clamp-1 md:max-w-full lg:text-3xl"
55
>
66
{{ title() }}
77
</h2>

libs/blog/layouts/ui-layouts/src/lib/header/header.component.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<header class="bg-al-background/95 z-30 h-20 w-full border-b shadow-xl">
1+
<header
2+
class="dark:bg-al-background/95 z-30 h-20 w-full border-b bg-white shadow-xl"
3+
>
24
<div
35
class="mx-auto flex h-full w-full max-w-screen-xl items-center justify-between px-6 py-4 xl:px-0"
46
>
@@ -29,7 +31,7 @@ <h1 class="text-al-primary px-4 text-lg font-bold">angular.love</h1>
2931
type="button"
3032
class="border-al-gray-200 mr-1 rounded border bg-transparent px-1 py-2 font-medium leading-4 md:mr-2 md:px-4"
3133
[ngClass]="{
32-
'!text-white': language() === 'en',
34+
'!text-al-foreground': language() === 'en',
3335
'!text-al-gray-50 opacity-50': language() !== 'en',
3436
}"
3537
[attr.aria-label]="t('changeLangToEnglish')"
@@ -42,7 +44,7 @@ <h1 class="text-al-primary px-4 text-lg font-bold">angular.love</h1>
4244
type="button"
4345
class="border-al-gray-200 mr-1 rounded border bg-transparent px-1 py-2 font-medium leading-4 md:mr-2 md:px-4"
4446
[ngClass]="{
45-
'!text-white': language() === 'pl',
47+
'!text-al-foreground': language() === 'pl',
4648
'!text-al-gray-50 opacity-50': language() !== 'pl',
4749
}"
4850
[attr.aria-label]="t('changeLangToPolish')"

libs/blog/newsletter/feature-newsletter/src/lib/feature-newsletter/newsletter.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="flex flex-col">
66
<h2
77
id="newsletter-title"
8-
class="text-4xl font-bold lg:text-2xl xl:text-4xl"
8+
class="text-al-primary-foreground text-4xl font-bold lg:text-2xl xl:text-4xl"
99
>
1010
{{ t('title') }}
1111
</h2>

libs/blog/shared/ui-card/src/lib/card.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class CardLinkableDirective {
6969
export class GradientCardDirective {
7070
@HostBinding('class')
7171
get hostClasses() {
72-
return 'border !bg-al-radial-gradient bg-al-background';
72+
return 'border !bg-al-radial-gradient bg-al-card dark:bg-al-background';
7373
}
7474
}
7575

libs/blog/shared/ui-difficulty/src/lib/ui-difficulty.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type UiDifficulty = 'beginner' | 'intermediate' | 'advanced';
2626
<div
2727
class="flex items-center self-stretch rounded-l-md pl-1 text-center align-middle xl:pl-2"
2828
[ngClass]="{
29-
'bg-al-background': isColorBackground(),
29+
'dark:bg-al-background bg-transparent': isColorBackground(),
3030
'bg-al-border': !isColorBackground(),
3131
}"
3232
>
@@ -45,7 +45,8 @@ export type UiDifficulty = 'beginner' | 'intermediate' | 'advanced';
4545
<div
4646
class="mx-0.5 inline-block h-4 w-4 rounded-full bg-transparent lg:mx-1"
4747
[ngClass]="{
48-
'shadow-al-full-background': isColorBackground(),
48+
'dark:shadow-al-full-background shadow-transparent':
49+
isColorBackground(),
4950
'shadow-al-full-border': !isColorBackground(),
5051
}"
5152
></div>
@@ -77,7 +78,7 @@ export type UiDifficulty = 'beginner' | 'intermediate' | 'advanced';
7778
<div
7879
class="flex items-center self-stretch rounded-r-md pr-1 text-center align-middle"
7980
[ngClass]="{
80-
'bg-al-background': isColorBackground(),
81+
'dark:bg-al-background bg-transparent': isColorBackground(),
8182
'bg-al-border': !isColorBackground(),
8283
}"
8384
></div>

libs/shared/assets/src/lib/styles/main.scss

+13
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,24 @@
88
:root {
99
--primary: 255 0 106;
1010
--foreground: 255 255 255;
11+
--primary-foreground: 255 255 255;
1112
--muted: 190 196 202;
1213
--border: 46 47 59;
1314
--card: 25 26 34;
1415
--background: 16 15 21;
1516
}
17+
18+
@media (prefers-color-scheme: light) {
19+
:root {
20+
--primary: 213 1 89;
21+
--foreground: 20 21 27;
22+
--primary-foreground: 106 121 139;
23+
--muted: 25 25 25;
24+
--border: 200 200 200;
25+
--card: 255 255 255;
26+
--background: 236 236 236;
27+
}
28+
}
1629
}
1730

1831
@layer base {

tailwind.preset.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/** @type {import('tailwindcss').Config} */
22
module.exports = {
3-
darkMode: ['class'],
43
theme: {
54
extend: {
65
colors: {
76
'al-foreground': 'rgb(var(--foreground) / <alpha-value>)',
7+
'al-primary-foreground':
8+
'rgb(var(--primary-foreground) / <alpha-value>)',
89
'al-card': 'rgb(var(--card) / <alpha-value>)',
910
'al-background': 'rgba(var(--background) / <alpha-value>)',
1011
'al-border': 'rgb(var(--border) / <alpha-value>)',

0 commit comments

Comments
 (0)