Skip to content

Commit 1eb3b3f

Browse files
authored
[feature] light and dark mode
1 parent e5f868a commit 1eb3b3f

32 files changed

+532
-295
lines changed

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ New-tab-page/Start-page for all browsers
1616
- <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>a</kbd> *to add a new bookmark*
1717
- <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>m</kbd> *to open menu*
1818
- <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>e</kbd> *to toggle edit state*
19+
- <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>d</kbd> *to toggle dark and light mode`
1920
- <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>r</kbd> *random theme if option is turned on in*`menu > layout > random Accent colour`
2021
- Responsive design
2122
- Customise Accent colour!

‎css/animation.css‎

100644100755
File mode changed.

‎css/background.css‎

100644100755
File mode changed.

‎css/base.css‎

100644100755
Lines changed: 92 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,48 @@
11
:root{
22
--black:0,0,0;
33
--white:255,255,255;
4-
--gray-01:38,40,49;
5-
--gray-02:47,51,62;
6-
--gray-03:57,62,75;
7-
--gray-04:67,73,88;
8-
--gray-05:77,84,101;
9-
--gray-06:87,95,114;
10-
--gray-07:97,106,127;
11-
--gray-08:107,117,140;
12-
--gray-09:117,128,153;
13-
--gray-10:127,139,166;
14-
--gray-11:137,151,180;
15-
--gray-12:149,162,187;
16-
--gray-13:162,173,195;
17-
--gray-14:174,184,203;
18-
--gray-15:187,195,211;
19-
--gray-16:199,206,218;
20-
--gray-17:212,217,226;
21-
--gray-18:224,228,234;
22-
--gray-19:237,239,242;
23-
--gray-20:250,250,250;
4+
--shade-01:38,40,49;
5+
--shade-02:47,51,62;
6+
--shade-03:57,62,75;
7+
--shade-04:67,73,88;
8+
--shade-05:77,84,101;
9+
--shade-06:87,95,114;
10+
--shade-07:97,106,127;
11+
--shade-08:107,117,140;
12+
--shade-09:117,128,153;
13+
--shade-10:127,139,166;
14+
--shade-11:137,151,180;
15+
--shade-12:149,162,187;
16+
--shade-13:162,173,195;
17+
--shade-14:174,184,203;
18+
--shade-15:187,195,211;
19+
--shade-16:199,206,218;
20+
--shade-17:212,217,226;
21+
--shade-18:224,228,234;
22+
--shade-19:237,239,242;
23+
--shade-20:250,250,250;
24+
--button-text:var(--gray-12);
25+
--button-text-hover-focus:var(--style-neutral-text);
26+
--button-text-active:var(--style-neutral-text);
27+
--button-text-disabled:var(--gray-04);
28+
--button-link-text:var(--gray-10);
29+
--button-link-text-hover-focus:var(--gray-14);
30+
--button-link-text-active:var(--gray-18);
31+
--button-link-text-disabled:var(--gray-04);
32+
--form-input-text:var(--gray-16);
33+
--form-input-text-hover:var(--style-neutral-text);
34+
--form-input-text-focus:var(--style-neutral-text);
35+
--form-input-text-disabled:var(--gray-04);
36+
--form-input-text-disabled-helper-text:var(--gray-04);
37+
--form-input-placeholder:var(--gray-06);
38+
--form-input-placeholder-hover-focus:var(--gray-10);
39+
--form-input-placeholder-disabled:var(--gray-04);
40+
--form-label:var(--gray-16);
41+
--form-label-disabled:var(--gray-04);
42+
--form-checkbox-radio-label:var(--gray-12);
43+
--form-checkbox-radio-chcked-label:var(--gray-16);
44+
--form-checkbox-radio-disabled-label:var(--gray-04);
45+
--form-range-thumb:var(--gray-12);
2446
--accent:0,255,0;
2547
--root-font-size:14px;
2648
--radius:0.2em;
@@ -91,13 +113,14 @@ html{
91113

92114
body{
93115
background-color:var(--background);
94-
color:rgb(var(--white));
116+
color:rgb(var(--style-neutral-text));
95117
font-size:1rem;
96118
line-height:1.6;
97119
font-family:var(--font-regular);
98120
display: flex;
99121
flex-direction: column;
100122
height:100vh;
123+
transition: background-color var(--animation-speed-fast) ease-in-out;
101124
}
102125

103126
.is-menu-openbody{
@@ -120,3 +143,51 @@ body{
120143
display: inherit;
121144
height: inherit;
122145
}
146+
147+
.is-theme-style-dark{
148+
--gray-01:var(--shade-01);
149+
--gray-02:var(--shade-02);
150+
--gray-03:var(--shade-03);
151+
--gray-04:var(--shade-04);
152+
--gray-05:var(--shade-05);
153+
--gray-06:var(--shade-06);
154+
--gray-07:var(--shade-07);
155+
--gray-08:var(--shade-08);
156+
--gray-09:var(--shade-09);
157+
--gray-10:var(--shade-10);
158+
--gray-11:var(--shade-11);
159+
--gray-12:var(--shade-12);
160+
--gray-13:var(--shade-13);
161+
--gray-14:var(--shade-14);
162+
--gray-15:var(--shade-15);
163+
--gray-16:var(--shade-16);
164+
--gray-17:var(--shade-17);
165+
--gray-18:var(--shade-18);
166+
--gray-19:var(--shade-19);
167+
--gray-20:var(--shade-20);
168+
--style-neutral-text:var(--white);
169+
}
170+
171+
.is-theme-style-light{
172+
--gray-01:var(--shade-20);
173+
--gray-02:var(--shade-19);
174+
--gray-03:var(--shade-18);
175+
--gray-04:var(--shade-17);
176+
--gray-05:var(--shade-16);
177+
--gray-06:var(--shade-15);
178+
--gray-07:var(--shade-14);
179+
--gray-08:var(--shade-13);
180+
--gray-09:var(--shade-12);
181+
--gray-10:var(--shade-11);
182+
--gray-11:var(--shade-10);
183+
--gray-12:var(--shade-09);
184+
--gray-13:var(--shade-08);
185+
--gray-14:var(--shade-07);
186+
--gray-15:var(--shade-06);
187+
--gray-16:var(--shade-05);
188+
--gray-17:var(--shade-04);
189+
--gray-18:var(--shade-03);
190+
--gray-19:var(--shade-02);
191+
--gray-20:var(--shade-01);
192+
--style-neutral-text:var(--black);
193+
}

‎css/button.css‎

100644100755
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ input[type="submit"]{
66
background-color:rgb(var(--gray-02));
77
padding:0.125em1em;
88
margin:001em0;
9-
color:rgb(var(--gray-12));
9+
color:rgb(var(--button-text));
1010
font-size:1em;
1111
font-family:var(--font-regular);
1212
min-height:2.5em;
@@ -41,7 +41,7 @@ input[type="submit"]:hover,
4141
input[type="submit"]:focus{
4242
background-color:rgb(var(--gray-03));
4343
border-bottom-color:rgb(var(--gray-08));
44-
color:rgb(var(--white));
44+
color:rgb(var(--button-text-hover-focus));
4545
outline: none;
4646
}
4747

@@ -52,7 +52,7 @@ input[type="reset"]:active,
5252
input[type="submit"]:active{
5353
background-color:rgb(var(--gray-04));
5454
border-bottom-color:rgb(var(--accent));
55-
color:rgb(var(--white));
55+
color:rgb(var(--button-text-active));
5656
transition: none;
5757
}
5858

@@ -66,7 +66,7 @@ button[disabled]:active,
6666
.button[disabled]:active{
6767
background-color:rgb(var(--gray-02));
6868
border-color: transparent;
69-
color:rgb(var(--gray-04));
69+
color:rgb(var(--button-text-disabled));
7070
cursor: default;
7171
}
7272

@@ -84,7 +84,7 @@ button [class*=" icon-"],
8484

8585
.button.active{
8686
border-bottom-color:rgb(var(--accent));
87-
color:rgb(var(--white));
87+
color:rgb(var(--button-text-active));
8888
}
8989

9090
.button-small{
@@ -152,28 +152,28 @@ button [class*=" button-"]:last-child,
152152
.button-link{
153153
background-color: transparent;
154154
border:0;
155-
color:rgb(var(--gray-10));
155+
color:rgb(var(--button-link-text));
156156
}
157157

158-
.button-link[disabled]{
158+
.button-link:hover,
159+
.button-link:focus{
159160
background-color: transparent;
160-
color: transparent;
161-
pointer-events: none;
161+
color:rgb(var(--button-link-text-hover-focus));
162162
}
163163

164-
.button-link:hover[disabled],
165-
.button-link:focus[disabled]{
164+
.button-link:active{
166165
background-color: transparent;
167-
color:transparent;
166+
color:rgb(var(--button-link-text-active));
168167
}
169168

170-
.button-link:hover,
171-
.button-link:focus{
169+
.button-link[disabled]{
172170
background-color: transparent;
173-
color:rgb(var(--gray-14));
171+
color: transparent;
172+
pointer-events: none;
174173
}
175174

176-
.button-link:active{
175+
.button-link:hover[disabled],
176+
.button-link:focus[disabled]{
177177
background-color: transparent;
178-
color:rgb(var(--gray-18));
178+
color:transparent;
179179
}

‎css/clock.css‎

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
border-radius:var(--radius);
55
font-size:1em;
66
font-family:var(--font-fjalla);
7-
color:rgb(var(--white));
7+
color:rgb(var(--style-neutral-text));
88
width:100%;
99
min-height:2.5em;
1010
display: flex;
@@ -47,7 +47,7 @@
4747
}
4848

4949
.clock-hours{
50-
color:rgb(var(--white));
50+
color:rgb(var(--style-neutral-text));
5151
}
5252

5353
.clock-minutes,

‎css/container.css‎

100644100755
File mode changed.

‎css/date.css‎

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
border-radius:var(--radius);
55
font-size:1em;
66
font-family:var(--font-fjalla);
7-
color:rgb(var(--white));
7+
color:rgb(var(--style-neutral-text));
88
width:100%;
99
min-height:2.5em;
1010
display: flex;
@@ -47,7 +47,7 @@
4747
}
4848

4949
.date-day{
50-
color:rgb(var(--white));
50+
color:rgb(var(--style-neutral-text));
5151
}
5252

5353
.date-date,

‎css/fonts.css‎

100644100755
File mode changed.

0 commit comments

Comments
(0)