Skip to content

Commit a43387d

Browse files
committed
complete DARK MODE
1 parent 6175826 commit a43387d

8 files changed

Lines changed: 101 additions & 17 deletions

File tree

src/component/Header.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ const Header = ({ superState, dispatcher }) => {
5252
onClick={() => dispatcher({ type: T.TOGGLE_DARK_MODE })}
5353
style={{
5454
cursor: 'pointer',
55-
padding: '0 15px',
55+
border: '1px solid #ccc',
56+
padding: '0 8px',
5657
display: 'flex',
5758
alignItems: 'center',
5859
justifyContent: 'center',
@@ -65,7 +66,9 @@ const Header = ({ superState, dispatcher }) => {
6566
onKeyDown={(e) => e.key === 'Enter' && dispatcher({ type: T.TOGGLE_DARK_MODE })}
6667
aria-label="Toggle dark mode"
6768
>
68-
{superState.darkMode ? <FaSun size={20} /> : <FaMoon size={20} />}
69+
{superState.darkMode
70+
? <FaSun size={20} className="theme-icon" />
71+
: <FaMoon size={20} className="theme-icon" />}
6972
</div>
7073
<FullScreenButton />
7174
</div>

src/component/header.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,9 @@
144144
[data-theme='dark'] .rc-switch-checked {
145145
border: 1px solid #2B8CF7;
146146
background-color: #2B8CF7;
147+
}
148+
149+
/* Theme Icon Color */
150+
.theme-icon {
151+
color: black;
147152
}

src/component/modals/FileEdit.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const FileEditModal = ({ superState, dispatcher }) => {
116116
<Editor
117117
height="60vh"
118118
language={language}
119-
theme="vs-light"
119+
theme={superState.darkMode ? 'vs-dark' : 'vs-light'}
120120
value={codeStuff}
121121
onChange={(value) => setCodeStuff(value)}
122122
options={{
Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,58 @@
1-
.contribute-details{
1+
.contribute-details {
22
padding: 20px;
33
display: grid;
44
grid-template-columns: auto auto;
55
gap: 20px;
66
}
77

8-
.contribute-details *{
8+
.contribute-details * {
99
padding: 10px 5px;
1010
text-align: center;
1111
}
1212

13-
.contribute-details .expand{
13+
.contribute-details .expand {
1414
grid-column: 1 / span 2;
1515
padding: 0;
1616
}
1717

18-
.contribute-details .btn{
18+
.contribute-details .btn {
1919
width: 100%;
2020
}
21-
.contribute-details .btn-secondary{
21+
22+
.contribute-details .btn-secondary {
2223
align-self: flex-end;
2324
}
24-
.contribute-details textarea{
25+
26+
.contribute-details textarea {
2527
resize: vertical;
2628
max-height: 200px;
2729
max-width: 300px;
2830
text-align: left;
2931
max-lines: 10;
3032
}
33+
3134
.Toastify__toast-container {
3235
/* width: 350px; */
3336
/* height: 80px; */
3437
padding: 3px 15px;
3538
display: inline-block;
36-
}
37-
38-
.Toastify__toast {
39+
}
40+
41+
.Toastify__toast {
3942
/* width: 350px; */
4043
/* height: 80px; */
4144
width: fit-content;
4245
font-size: 16px;
43-
}
46+
}
47+
48+
/* DARK MODE STYLES */
49+
[data-theme='dark'] .contribute-details input,
50+
[data-theme='dark'] .contribute-details textarea {
51+
background-color: #1a1a1a;
52+
border: 1px solid #444;
53+
color: #e5e7eb;
54+
}
55+
56+
[data-theme='dark'] .contribute-details span {
57+
color: #e5e7eb;
58+
}

src/component/modals/graph-comp-details.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@
1818
color: #f00;
1919
font-family: monospaceoo;
2020
padding-bottom: 20px;
21+
}
22+
23+
[data-theme='dark'] .ReactModalPortal .modal-footer {
24+
border-top: 1px solid #333;
2125
}

src/component/modals/nodeDetails.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,27 @@
106106
grid-template-columns: auto auto;
107107
width: auto
108108
}
109+
109110
.nodeform .nodeLabel {
110111
grid-column: 2 / span 1;
111112
}
113+
112114
.nodeform .nodeLabelFile {
113115
grid-column: 2 / span 1;
114116
}
117+
}
118+
119+
/* DARK MODE STYLES */
120+
[data-theme='dark'] .parent-div {
121+
background: #1a1a1a;
122+
}
123+
124+
[data-theme='dark'] .nodeform input {
125+
background-color: #1a1a1a;
126+
border: 1px solid #444;
127+
color: #e5e7eb;
128+
}
129+
130+
[data-theme='dark'] .nodeform div {
131+
color: #e5e7eb;
115132
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
.main-div {
22
padding: 30px;
33
}
4+
45
.main-div-comp {
56
margin: 20px;
7+
}
8+
9+
/* DARK MODE STYLES */
10+
[data-theme='dark'] .main-div input[type="text"],
11+
[data-theme='dark'] .main-div textarea {
12+
background-color: #1a1a1a;
13+
border: 1px solid #444;
14+
color: #e5e7eb;
15+
padding: 5px;
16+
}
17+
18+
[data-theme='dark'] .main-div input[type="checkbox"] {
19+
accent-color: #3b82f6;
20+
}
21+
22+
[data-theme='dark'] .main-div label,
23+
[data-theme='dark'] .main-div span {
24+
color: #e5e7eb;
625
}

src/component/modals/parent-modal.css

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
transition: all 200ms ease-out;
33
}
44

5-
.ReactModalPortal, .ReactModal__Overlay {
5+
.ReactModalPortal,
6+
.ReactModal__Overlay {
67
z-index: 3
78
}
89

@@ -43,8 +44,8 @@
4344
line-height: 1.5;
4445
}
4546

46-
.modal-body{
47-
max-height: calc( 80vh - 70px);
47+
.modal-body {
48+
max-height: calc(80vh - 70px);
4849
overflow: auto;
4950
}
5051

@@ -114,7 +115,8 @@
114115
.ReactModalPortal .Overlay.closing {
115116
opacity: 0;
116117
}
117-
.ReactModal__Overlay.ReactModal__Overlay--after-open.Overlay{
118+
119+
.ReactModal__Overlay.ReactModal__Overlay--after-open.Overlay {
118120
overflow: auto;
119121
}
120122

@@ -128,4 +130,23 @@
128130
.ReactModalPortal .Modal {
129131
min-width: 90%;
130132
}
133+
}
134+
135+
/* DARK MODE STYLES */
136+
[data-theme='dark'] .ReactModalPortal .modal-content {
137+
background-color: #262626;
138+
border: 1px solid #444;
139+
color: #e5e7eb;
140+
}
141+
142+
[data-theme='dark'] .ReactModalPortal .modal-header {
143+
border-bottom: 1px solid #333;
144+
}
145+
146+
[data-theme='dark'] .ReactModalPortal .modal-header .close {
147+
color: #e5e7eb;
148+
}
149+
150+
[data-theme='dark'] .ReactModalPortal .modal-title {
151+
color: #e5e7eb;
131152
}

0 commit comments

Comments
 (0)