File tree 9 files changed +324
-573
lines changed
9 files changed +324
-573
lines changed Original file line number Diff line number Diff line change 13
13
padding : 0 ;
14
14
}
15
15
}
16
+
17
+ body .dark-mode .acknowledgements {
18
+ background-color : #161a1d ;
19
+ color : #ffffff ;
20
+
21
+ .card {
22
+ background-color : #1d2125 ;
23
+ color : #ffffff ;
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ import React , { useState , useEffect } from 'react' ;
2
+ import Toggle from 'react-toggle' ;
3
+
4
+ const DarkMode = ( ) => {
5
+ const [ darkMode , setDarkMode ] = useState ( ( ) => {
6
+ const savedMode = localStorage . getItem ( 'darkMode' ) ;
7
+ return savedMode ? JSON . parse ( savedMode ) : false ;
8
+ } ) ;
9
+
10
+ const toggleDarkMode = ( ) => {
11
+ setDarkMode ( prevMode => {
12
+ const newMode = ! prevMode ;
13
+ localStorage . setItem ( 'darkMode' , newMode ) ;
14
+ return newMode ;
15
+ } ) ;
16
+ } ;
17
+ useEffect ( ( ) => {
18
+ document . body . className = darkMode ? 'dark-mode' : 'light-mode' ;
19
+ } , [ darkMode ] ) ;
20
+
21
+ return (
22
+ < Toggle
23
+ id = "darkMode-toggle"
24
+ checked = { darkMode }
25
+ onChange = { toggleDarkMode }
26
+ icons = { { checked : '🌙' , unchecked : '☀️' } }
27
+ />
28
+ ) ;
29
+ } ;
30
+
31
+ export default DarkMode ;
Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ import { FaGithub } from 'react-icons/fa';
11
11
import { Event } from '../Shared/Tracking' ;
12
12
13
13
import './styles.scss' ;
14
+ import DarkMode from '../Dark-Mode' ;
14
15
15
16
const Navigation = ( ) => {
16
17
return (
17
- < Navbar color = "light" light >
18
+ < Navbar className = "navbar" >
18
19
< Container >
19
20
< NavbarBrand
20
21
onClick = { ( ) =>
@@ -34,6 +35,7 @@ const Navigation = () => {
34
35
</ NavLink >
35
36
</ NavItem >
36
37
</ Nav >
38
+ < DarkMode />
37
39
</ Container >
38
40
</ Navbar >
39
41
) ;
Original file line number Diff line number Diff line change
1
+ body .light-mode .navbar {
2
+ background-color : #f7f8f9 ;
3
+ color : #000000 ;
4
+ }
5
+ body .light-mode .navbar a {
6
+ color : #212529 ;
7
+ }
8
+
9
+ body .dark-mode .navbar {
10
+ background-color : #1d2125 ;
11
+ color : #ffffff ;
12
+ }
13
+ body .dark-mode .navbar a {
14
+ color : #ffffff ;
15
+ }
16
+ body .dark-mode .navbar-nav svg {
17
+ color : #ffffff ;
18
+ }
19
+ body .dark-mode .navbar-nav svg :hover {
20
+ color : #ffc952 ;
21
+ }
22
+
1
23
.navbar-brand {
2
24
font-weight : 600 ;
3
25
letter-spacing : 1px ;
29
51
30
52
svg {
31
53
font-size : 2em ;
54
+ margin : 0px 10px ;
32
55
}
33
56
}
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ const Table = () => {
176
176
labelPosition = { 0 }
177
177
labelStyle = { {
178
178
// Needed for Dark Reader to work
179
- fill : 'black ' ,
179
+ fill : '#A54800 ' ,
180
180
} }
181
181
startAngle = { - 90 }
182
182
lineWidth = { 12 }
Original file line number Diff line number Diff line change
1
+ body .light-mode .table {
2
+ background-color : #ffffff ;
3
+ color : #000000 ;
4
+ }
5
+ body .light-mode .table thead > tr th {
6
+ background-color : #ffffff ;
7
+ }
8
+ body .light-mode .pattern-count {
9
+ background-color : #ffffff ;
10
+ color : #000000 ;
11
+ }
12
+ body .light-mode .table tr :nth-child (odd ) {
13
+ background-color : #f1f2f4 ;
14
+ }
15
+ body .light-mode .table tr :nth-child (even ) {
16
+ background-color : #ffffff ;
17
+ }
18
+ body .light-mode .table tbody tr :hover {
19
+ background-color : #dcdfe4 ;
20
+ color : #000000 ;
21
+ }
22
+
23
+ body .dark-mode .table {
24
+ background-color : #161a1d ;
25
+ color : #ffffff ;
26
+ }
27
+ body .dark-mode .table thead > tr th {
28
+ background-color : #161a1d ;
29
+ }
30
+ body .dark-mode .pattern-count {
31
+ background-color : #161a1d ;
32
+ color : #ffffff ;
33
+ }
34
+ body .dark-mode .table tr :nth-child (odd ) {
35
+ background-color : #22272b ;
36
+ }
37
+ body .dark-mode .table tr :nth-child (even ) {
38
+ background-color : #161a1d ;
39
+ }
40
+ body .dark-mode .table tbody tr :hover {
41
+ background-color : #101214 ;
42
+ color : #ffffff ;
43
+ }
44
+ body .dark-mode .modal-content {
45
+ background-color : #1d2125 ;
46
+ color : #ffffff ;
47
+ .close {
48
+ color : #ffffff ;
49
+ }
50
+ }
51
+
1
52
.table {
2
53
.row {
3
54
justify-content : center ;
Original file line number Diff line number Diff line change 7
7
color : #333 ;
8
8
background : #f8f8f8 ;
9
9
}
10
+ body .light-mode .tips {
11
+ background-color : #f7f8f9 ;
12
+ color : #333 ;
13
+ }
14
+
15
+ body .dark-mode .tips {
16
+ background-color : #1d2125 ;
17
+ color : #ffffff ;
18
+ }
19
+ body .dark-mode .tips pre ,
20
+ body .dark-mode .tips code {
21
+ background-color : #1d2125 ;
22
+ color : #ffffff ;
23
+ }
Original file line number Diff line number Diff line change 1
1
@import url (' https://fonts.googleapis.com/css?family=Open+Sans:400,700' );
2
2
3
3
.App {
4
- margin-left : calc (100vw - 100% );
5
4
margin-right : 0 ;
6
-
7
5
font-family : ' Open Sans' , sans-serif ;
8
6
font-size : 14px ;
9
7
-webkit-font-smoothing : antialiased !important ;
10
8
}
9
+
10
+ body .light-mode {
11
+ background-color : #ffffff ;
12
+ color : #000000 ;
13
+ }
14
+ body .light-mode a {
15
+ color : #0c66e4 ;
16
+ }
17
+
18
+ body .dark-mode {
19
+ background-color : #161a1d ;
20
+ color : #ffffff ;
21
+ }
22
+ body .dark-mode a {
23
+ color : #579dff ;
24
+ }
You can’t perform that action at this time.
0 commit comments