Skip to content

Commit 7201144

Browse files
authored
Merge pull request #661 from edoardoo/darkTheme
Implemented dark theme.
2 parents a8fa888 + 6fc2c39 commit 7201144

File tree

9 files changed

+199
-12
lines changed

9 files changed

+199
-12
lines changed

locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,6 @@
102102
"Select From Available Snippets": "Select From Available Snippets",
103103
"OR": "OR",
104104
"Export to Snippet": "Export to Snippet",
105-
"Select Visibility Level": "Select Visibility Level"
105+
"Select Visibility Level": "Select Visibility Level",
106+
"Night Theme": "Night Theme"
106107
}

public/css/extra.css

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@
179179
border-left: 1px solid black;
180180
}
181181

182+
.night .ui-toc-dropdown .nav>li>a:focus, .night .ui-toc-dropdown .nav>li>a:hover{
183+
color: white;
184+
border-left-color: white;
185+
}
186+
182187
.ui-toc-dropdown[dir='rtl'] .nav>li>a:focus,.ui-toc-dropdown[dir='rtl'] .nav>li>a:hover {
183188
padding-right: 19px;
184189
border-left: none;
@@ -192,6 +197,10 @@
192197
background-color: transparent;
193198
border-left: 2px solid black;
194199
}
200+
.night .ui-toc-dropdown .nav>.active:focus>a,.night .ui-toc-dropdown .nav>.active:hover>a,.night .ui-toc-dropdown .nav>.active>a {
201+
color: white;
202+
border-left: 2px solid white;
203+
}
195204

196205
.ui-toc-dropdown[dir='rtl'] .nav>.active:focus>a,.ui-toc-dropdown[dir='rtl'] .nav>.active:hover>a,.ui-toc-dropdown[dir='rtl'] .nav>.active>a {
197206
padding-right: 18px;
@@ -216,6 +225,10 @@
216225
font-weight: 400;
217226
}
218227

228+
.night .ui-toc-dropdown .nav > li > a{
229+
color: #aaa;
230+
}
231+
219232
.ui-toc-dropdown[dir='rtl'] .nav .nav>li>a {
220233
padding-right: 30px;
221234
}
@@ -350,18 +363,28 @@ small .dropdown a:focus, small .dropdown a:hover {
350363
}
351364

352365
.unselectable {
353-
-moz-user-select: none;
354-
-khtml-user-select: none;
355-
-webkit-user-select: none;
366+
-moz-user-select: none;
367+
-khtml-user-select: none;
368+
-webkit-user-select: none;
356369
-o-user-select: none;
357370
user-select: none;
358371
}
359372

373+
.night .navbar{
374+
background: #333;
375+
border-bottom-color: #333;
376+
color: #eee;
377+
}
378+
379+
.night .navbar a{
380+
color: #eee;
381+
}
382+
360383
@media print {
361384
div, table, img, pre, blockquote {
362385
page-break-inside: avoid !important;
363386
}
364387
a[href]:after {
365388
font-size: 12px !important;
366389
}
367-
}
390+
}

public/css/github-extract.css

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
color: #777;
6969
border-left: 0.25em solid #ddd;
7070
}
71+
.night .markdown-body blockquote{
72+
color: #bcbcbc;
73+
}
7174

7275
.markdown-body blockquote>:first-child {
7376
margin-top: 0;
@@ -107,6 +110,15 @@
107110
line-height: 1.25;
108111
}
109112

113+
.night .markdown-body h1,
114+
.night .markdown-body h2,
115+
.night .markdown-body h3,
116+
.night .markdown-body h4,
117+
.night .markdown-body h5,
118+
.night .markdown-body h6 {
119+
color: #ddd;
120+
}
121+
110122
.markdown-body h1 .octicon-link,
111123
.markdown-body h2 .octicon-link,
112124
.markdown-body h3 .octicon-link,
@@ -118,6 +130,15 @@
118130
visibility: hidden;
119131
}
120132

133+
.night .markdown-body h1 .octicon-link,
134+
.night .markdown-body h2 .octicon-link,
135+
.night .markdown-body h3 .octicon-link,
136+
.night .markdown-body h4 .octicon-link,
137+
.night .markdown-body h5 .octicon-link,
138+
.night .markdown-body h6 .octicon-link {
139+
color: #fff;
140+
}
141+
121142
.markdown-body h1:hover .anchor,
122143
.markdown-body h2:hover .anchor,
123144
.markdown-body h3:hover .anchor,
@@ -180,6 +201,8 @@
180201
color: #777
181202
}
182203

204+
205+
183206
.markdown-body ul,
184207
.markdown-body ol {
185208
padding-left: 2em
@@ -246,11 +269,19 @@
246269
background-color: #fff;
247270
border-top: 1px solid #ccc;
248271
}
272+
.night .markdown-body table tr {
273+
background-color: #5f5f5f;
274+
}
249275

250276
.markdown-body table tr:nth-child(2n) {
251277
background-color: #f8f8f8;
252278
}
253279

280+
.night .markdown-body table tr:nth-child(2n){
281+
282+
background-color: #4f4f4f;
283+
}
284+
254285
.markdown-body img {
255286
max-width: 100%;
256287
box-sizing: content-box;
@@ -370,6 +401,14 @@
370401
border-radius: 3px;
371402
}
372403

404+
.night .markdown-body code,
405+
.night .markdown-body tt {
406+
407+
color: #eee;
408+
background-color: rgba(230, 230, 230, 0.36);
409+
410+
}
411+
373412
.markdown-body code::before,
374413
.markdown-body code::after,
375414
.markdown-body tt::before,
@@ -512,4 +551,4 @@
512551
margin: 0.31em 0 0.2em -1.3em !important;
513552
vertical-align: middle;
514553
cursor: default !important;
515-
}
554+
}

public/css/index.css

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ body {
1010
padding-top: 51px;
1111
/*overflow: hidden;*/
1212
}
13+
14+
.night a,
15+
.night .open-files-container li.selected a {
16+
color: #5EB7E0;
17+
}
18+
19+
body.night{
20+
background: #333 !important;
21+
}
22+
1323
.CodeMirror {
1424
font-family: "Source Code Pro", Consolas, monaco, monospace;
1525
letter-spacing: 0.025em;
@@ -117,6 +127,11 @@ body {
117127
margin-left: 0;
118128
margin-right: 0;
119129
}
130+
131+
.night .ui-content{
132+
background-color: #333;
133+
}
134+
120135
.ui-edit-area {
121136
height: 100%;
122137
/*padding-left: 15px;*/
@@ -144,6 +159,12 @@ body {
144159
.ui-edit-area .ui-sync-toggle:active {
145160
box-shadow: inset 0 3px 5px rgba(0,0,0,.125), 2px 0px 2px #e7e7e7;
146161
}
162+
163+
.night .ui-edit-area .ui-resizable-handle.ui-resizable-e{
164+
background: #3c3c3c;
165+
box-shadow: 3px 0px 6px #353535;
166+
}
167+
147168
.ui-view-area {
148169
/*overflow-y: scroll;*/
149170
-webkit-overflow-scrolling: touch;
@@ -154,6 +175,13 @@ body {
154175
padding-right: 15px;
155176
}
156177
}
178+
179+
.night .ui-view-area{
180+
background: #333;
181+
color: #ededed;
182+
}
183+
184+
157185
.ui-scrollable {
158186
height: 100%;
159187
overflow-x: hidden;
@@ -238,12 +266,32 @@ body {
238266
.navbar-nav > li > a {
239267
cursor: pointer;
240268
}
269+
270+
.night .navbar-default .navbar-nav > li > a:focus,
271+
.night .navbar-default .navbar-nav > li > a:hover,
272+
.night .navbar-default .navbar-brand:focus,
273+
.night .navbar-default .navbar-brand:hover{
274+
color: #fff;
275+
}
276+
277+
.night .navbar-default .navbar-nav > .open > a,
278+
.night .navbar-default .navbar-nav > .open > a:focus,
279+
.night .navbar-default .navbar-nav > .open > a:hover {
280+
color: white;
281+
background: #000;
282+
283+
}
241284
.dropdown-menu > li > a {
242285
cursor: pointer;
243286
text-overflow: ellipsis;
244287
max-width: calc(100vw - 30px);
245288
overflow: hidden;
246289
}
290+
291+
.night .dropdown-menu{
292+
background: #222;
293+
}
294+
247295
.dropdown-menu.CodeMirror-other-cursor {
248296
transition: none;
249297
}
@@ -276,8 +324,8 @@ div[contenteditable]:empty:not(:focus):before{
276324
max-height: 40vh;
277325
overflow: auto;
278326
}
279-
.dropdown-menu.list::-webkit-scrollbar {
280-
display: none;
327+
.dropdown-menu.list::-webkit-scrollbar {
328+
display: none;
281329
}
282330
.dropdown-menu .emoji {
283331
margin-bottom: 0 !important;
@@ -292,6 +340,16 @@ div[contenteditable]:empty:not(:focus):before{
292340
background: inherit;
293341
}
294342

343+
.night .navbar .btn-default{
344+
background-color: #333;
345+
border-color: #565656;
346+
color: #eee;
347+
}
348+
349+
.night .btn.btn-default.ui-view.active{
350+
background: #202020;
351+
}
352+
295353
.btn-file {
296354
position: relative;
297355
overflow: hidden;
@@ -312,6 +370,12 @@ div[contenteditable]:empty:not(:focus):before{
312370
display: block;
313371
}
314372

373+
.night .btn.focus,
374+
.night .btn:focus,
375+
.night .btn:hover{
376+
color: #fff;
377+
}
378+
315379
.info-label {
316380
width: 36%;
317381
text-align: right;
@@ -481,8 +545,8 @@ div[contenteditable]:empty:not(:focus):before{
481545
border: 1px solid #2893ef;
482546
}
483547

484-
.status-bar .indent-width-input::-webkit-inner-spin-button,
485-
.status-bar .indent-width-input::-webkit-outer-spin-button {
548+
.status-bar .indent-width-input::-webkit-inner-spin-button,
549+
.status-bar .indent-width-input::-webkit-outer-spin-button {
486550
-webkit-appearance: none;
487551
margin: 0;
488552
}
@@ -524,4 +588,4 @@ div[contenteditable]:empty:not(:focus):before{
524588
.CodeMirror {
525589
height: auto !important;
526590
}
527-
}
591+
}

public/css/markdown.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@
6969
border-collapse: inherit !important;
7070
}
7171

72+
.night .markdown-body .gist table tr:nth-child(2n){
73+
74+
background-color: #ddd;
75+
76+
}
77+
7278
.markdown-body code[data-gist-id] {
7379
background: none;
7480
padding: 0;
@@ -93,6 +99,7 @@
9399

94100
.markdown-body code[data-gist-id] table tr {
95101
background: unset;
102+
96103
}
97104

98105
/*fixed style for rtl in pre and code*/
@@ -121,6 +128,16 @@
121128
white-space: inherit;
122129
}
123130

131+
.night .markdown-body pre.graphviz .graph > polygon{
132+
fill: #333;
133+
}
134+
135+
.night .markdown-body pre.mermaid .titleText,
136+
.night .markdown-body pre.mermaid text,
137+
.night .markdown-body pre.mermaid .sectionTitle{
138+
fill: white;
139+
}
140+
124141
.markdown-body pre.flow-chart > code,
125142
.markdown-body pre.sequence-diagram > code,
126143
.markdown-body pre.graphviz > code,
@@ -138,6 +155,27 @@
138155
height: 100%;
139156
}
140157

158+
.night .markdown-body .abc path{
159+
fill: #eee;
160+
}
161+
162+
.night .markdown-body .abc path.note_selected{
163+
fill: ##4DD0E1;
164+
}
165+
166+
.night tspan{
167+
fill: #fefefe;
168+
}
169+
170+
.night pre rect{
171+
fill: transparent;
172+
}
173+
174+
.night pre.flow-chart rect,
175+
.night pre.flow-chart path{
176+
stroke: white;
177+
}
178+
141179
.markdown-body pre > code.wrap {
142180
white-space: pre-wrap; /* Since CSS 2.1 */
143181
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */

0 commit comments

Comments
 (0)