Skip to content

Commit ac7512d

Browse files
authored
Merge pull request #240 from oliverfencott/add-dark-theme
Add dark theme
2 parents b9969ab + 33775f2 commit ac7512d

File tree

4 files changed

+193
-62
lines changed

4 files changed

+193
-62
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ site
33
janet_modules
44
build
55
/jpm/
6+
7+
.vscode

static/css/docpage.css

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
padding: 5px;
5050
background: gray;
5151
}
52-
5352
}
5453

5554
/*
@@ -76,11 +75,11 @@
7675
}
7776

7877
.toc span.selected {
79-
background: #0765911a;
78+
background: #0765911a;
8079
}
81-
80+
8281
.toc span:hover {
83-
background: #0765911a;
82+
background: #0765911a;
8483
}
8584

8685
.toc ul {
@@ -111,6 +110,12 @@
111110
color: #888;
112111
}
113112

113+
@media (prefers-color-scheme: dark) {
114+
.binding-type {
115+
color: #ccc;
116+
}
117+
}
118+
114119
.binding-sym {
115120
font-family: serif;
116121
font-weight: 600;
@@ -119,13 +124,25 @@
119124
.binding-text {
120125
color: #444;
121126
margin-top: 14px;
122-
font-family: 'Dosis','Helvetica', sans-serif;
127+
font-family: 'Dosis', 'Helvetica', sans-serif;
128+
}
129+
130+
@media (prefers-color-scheme: dark) {
131+
.binding-text {
132+
color: unset;
133+
}
123134
}
124135

125136
.example-title {
126137
margin-top: 28px;
127138
color: #888;
128-
font-family: 'Dosis','Helvetica', sans-serif;
139+
font-family: 'Dosis', 'Helvetica', sans-serif;
140+
}
141+
142+
@media (prefers-color-scheme: dark) {
143+
.example-title {
144+
color: #ccc;
145+
}
129146
}
130147

131148
/* Toc Toggle */
@@ -144,7 +161,7 @@
144161
height: 4px;
145162
width: 28px;
146163
border-radius: 2px;
147-
background: #CCC;
164+
background: #ccc;
148165
}
149166

150167
#toc-toggle.open .topbar {
@@ -171,7 +188,7 @@
171188
}
172189

173190
.prev .prevnext-text::before {
174-
content: "< ";
191+
content: '< ';
175192
}
176193

177194
.next {
@@ -180,5 +197,5 @@
180197
}
181198

182199
.next .prevnext-text::after {
183-
content: " >";
184-
}
200+
content: ' >';
201+
}

static/css/landing.css

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262

6363
#replterm {
6464
border-radius: 2px 2px 0 0;
65-
border-top: solid #CCC 1px;
66-
border-left: solid #CCC 1px;
67-
border-right: solid #CCC 1px;
65+
border-top: solid #ccc 1px;
66+
border-left: solid #ccc 1px;
67+
border-right: solid #ccc 1px;
6868
font-family: 'Inconsolata', monospace;
6969
padding: 10px;
7070
height: 350px;
@@ -74,14 +74,30 @@
7474
overflow-y: auto;
7575
}
7676

77+
@media (prefers-color-scheme: dark) {
78+
#replterm {
79+
border-color: #333;
80+
background: #333;
81+
color: #ccc;
82+
}
83+
}
84+
7785
#replinbar {
7886
border-radius: 0 0 2px 2px;
79-
border: solid #CCC 1px;
87+
border: solid #ccc 1px;
8088
font-family: 'Inconsolata', monospace;
8189
margin: 0 10px 10px 10px;
8290
color: black;
8391
display: flex;
84-
background: #F8F8F8;
92+
background: #f8f8f8;
93+
}
94+
95+
@media (prefers-color-scheme: dark) {
96+
#replinbar {
97+
border-color: #333;
98+
color: unset;
99+
background: #1a1a1a;
100+
}
85101
}
86102

87103
#replprompt {
@@ -99,12 +115,18 @@
99115
margin: 0;
100116
width: 100%;
101117
transition: background 0.3s;
102-
text-indent 2px;
118+
text-indent: 2px;
103119
}
104120

105121
#replin:focus {
106122
outline: none;
107-
background: #F0F0F0;
123+
background: #f0f0f0;
124+
}
125+
126+
@media (prefers-color-scheme: dark) {
127+
#replin:focus {
128+
background: unset;
129+
}
108130
}
109131

110132
#replin br {
@@ -118,8 +140,8 @@
118140

119141
/* Github Banner */
120142

121-
.github-corner:hover .octo-arm{
122-
animation:octocat-wave 560ms ease-in-out;
143+
.github-corner:hover .octo-arm {
144+
animation: octocat-wave 560ms ease-in-out;
123145
}
124146

125147
/* Donate button */
@@ -128,23 +150,23 @@
128150
margin: 0 15px;
129151
}
130152

131-
@keyframes octocat-wave{
153+
@keyframes octocat-wave {
132154
0%, 100% {
133-
transform:rotate(0);
155+
transform: rotate(0);
134156
}
135157
20%, 60% {
136-
transform:rotate(-25deg);
158+
transform: rotate(-25deg);
137159
}
138-
40%, 80%{
139-
transform:rotate(10deg);
160+
40%, 80% {
161+
transform: rotate(10deg);
140162
}
141163
}
142164

143-
@media (max-width:500px) {
165+
@media (max-width: 500px) {
144166
.github-corner:hover .octo-arm {
145-
animation:none;
167+
animation: none;
146168
}
147169
.github-corner .octo-arm {
148-
animation:octocat-wave 560ms ease-in-out;
170+
animation: octocat-wave 560ms ease-in-out;
149171
}
150-
}
172+
}

0 commit comments

Comments
 (0)