UNPKG

12.1 kBCSSView Raw
1/**
2 * One Dark theme for prism.js
3 * Based on Atom's One Dark theme: https://github.com/atom/atom/tree/master/packages/one-dark-syntax
4 */
5
6/**
7 * One Dark colours (accurate as of commit 8ae45ca on 6 Sep 2018)
8 * From colors.less
9 * --mono-1: hsl(220, 14%, 71%);
10 * --mono-2: hsl(220, 9%, 55%);
11 * --mono-3: hsl(220, 10%, 40%);
12 * --hue-1: hsl(187, 47%, 55%);
13 * --hue-2: hsl(207, 82%, 66%);
14 * --hue-3: hsl(286, 60%, 67%);
15 * --hue-4: hsl(95, 38%, 62%);
16 * --hue-5: hsl(355, 65%, 65%);
17 * --hue-5-2: hsl(5, 48%, 51%);
18 * --hue-6: hsl(29, 54%, 61%);
19 * --hue-6-2: hsl(39, 67%, 69%);
20 * --syntax-fg: hsl(220, 14%, 71%);
21 * --syntax-bg: hsl(220, 13%, 18%);
22 * --syntax-gutter: hsl(220, 14%, 45%);
23 * --syntax-guide: hsla(220, 14%, 71%, 0.15);
24 * --syntax-accent: hsl(220, 100%, 66%);
25 * From syntax-variables.less
26 * --syntax-selection-color: hsl(220, 13%, 28%);
27 * --syntax-gutter-background-color-selected: hsl(220, 13%, 26%);
28 * --syntax-cursor-line: hsla(220, 100%, 80%, 0.04);
29 */
30
31code[class*="language-"],
32pre[class*="language-"] {
33 background: hsl(220, 13%, 18%);
34 color: hsl(220, 14%, 71%);
35 text-shadow: 0 1px rgba(0, 0, 0, 0.3);
36 font-family: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
37 direction: ltr;
38 text-align: left;
39 white-space: pre;
40 word-spacing: normal;
41 word-break: normal;
42 line-height: 1.5;
43 -moz-tab-size: 2;
44 -o-tab-size: 2;
45 tab-size: 2;
46 -webkit-hyphens: none;
47 -moz-hyphens: none;
48 -ms-hyphens: none;
49 hyphens: none;
50}
51
52/* Selection */
53code[class*="language-"]::-moz-selection,
54code[class*="language-"] *::-moz-selection,
55pre[class*="language-"] *::-moz-selection {
56 background: hsl(220, 13%, 28%);
57 color: inherit;
58 text-shadow: none;
59}
60
61code[class*="language-"]::selection,
62code[class*="language-"] *::selection,
63pre[class*="language-"] *::selection {
64 background: hsl(220, 13%, 28%);
65 color: inherit;
66 text-shadow: none;
67}
68
69/* Code blocks */
70pre[class*="language-"] {
71 padding: 1em;
72 margin: 0.5em 0;
73 overflow: auto;
74 border-radius: 0.3em;
75}
76
77/* Inline code */
78:not(pre) > code[class*="language-"] {
79 padding: 0.2em 0.3em;
80 border-radius: 0.3em;
81 white-space: normal;
82}
83
84/* Print */
85@media print {
86 code[class*="language-"],
87 pre[class*="language-"] {
88 text-shadow: none;
89 }
90}
91
92.token.comment,
93.token.prolog,
94.token.cdata {
95 color: hsl(220, 10%, 40%);
96}
97
98.token.doctype,
99.token.punctuation,
100.token.entity {
101 color: hsl(220, 14%, 71%);
102}
103
104.token.attr-name,
105.token.class-name,
106.token.boolean,
107.token.constant,
108.token.number,
109.token.atrule {
110 color: hsl(29, 54%, 61%);
111}
112
113.token.keyword {
114 color: hsl(286, 60%, 67%);
115}
116
117.token.property,
118.token.tag,
119.token.symbol,
120.token.deleted,
121.token.important {
122 color: hsl(355, 65%, 65%);
123}
124
125.token.selector,
126.token.string,
127.token.char,
128.token.builtin,
129.token.inserted,
130.token.regex,
131.token.attr-value,
132.token.attr-value > .token.punctuation {
133 color: hsl(95, 38%, 62%);
134}
135
136.token.variable,
137.token.operator,
138.token.function {
139 color: hsl(207, 82%, 66%);
140}
141
142.token.url {
143 color: hsl(187, 47%, 55%);
144}
145
146/* HTML overrides */
147.token.attr-value > .token.punctuation.attr-equals,
148.token.special-attr > .token.attr-value > .token.value.css {
149 color: hsl(220, 14%, 71%);
150}
151
152/* CSS overrides */
153.language-css .token.selector {
154 color: hsl(355, 65%, 65%);
155}
156
157.language-css .token.property {
158 color: hsl(220, 14%, 71%);
159}
160
161.language-css .token.function,
162.language-css .token.url > .token.function {
163 color: hsl(187, 47%, 55%);
164}
165
166.language-css .token.url > .token.string.url {
167 color: hsl(95, 38%, 62%);
168}
169
170.language-css .token.important,
171.language-css .token.atrule .token.rule {
172 color: hsl(286, 60%, 67%);
173}
174
175/* JS overrides */
176.language-javascript .token.operator {
177 color: hsl(286, 60%, 67%);
178}
179
180.language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation {
181 color: hsl(5, 48%, 51%);
182}
183
184/* JSON overrides */
185.language-json .token.operator {
186 color: hsl(220, 14%, 71%);
187}
188
189.language-json .token.null.keyword {
190 color: hsl(29, 54%, 61%);
191}
192
193/* MD overrides */
194.language-markdown .token.url,
195.language-markdown .token.url > .token.operator,
196.language-markdown .token.url-reference.url > .token.string {
197 color: hsl(220, 14%, 71%);
198}
199
200.language-markdown .token.url > .token.content {
201 color: hsl(207, 82%, 66%);
202}
203
204.language-markdown .token.url > .token.url,
205.language-markdown .token.url-reference.url {
206 color: hsl(187, 47%, 55%);
207}
208
209.language-markdown .token.blockquote.punctuation,
210.language-markdown .token.hr.punctuation {
211 color: hsl(220, 10%, 40%);
212 font-style: italic;
213}
214
215.language-markdown .token.code-snippet {
216 color: hsl(95, 38%, 62%);
217}
218
219.language-markdown .token.bold .token.content {
220 color: hsl(29, 54%, 61%);
221}
222
223.language-markdown .token.italic .token.content {
224 color: hsl(286, 60%, 67%);
225}
226
227.language-markdown .token.strike .token.content,
228.language-markdown .token.strike .token.punctuation,
229.language-markdown .token.list.punctuation,
230.language-markdown .token.title.important > .token.punctuation {
231 color: hsl(355, 65%, 65%);
232}
233
234/* General */
235.token.bold {
236 font-weight: bold;
237}
238
239.token.comment,
240.token.italic {
241 font-style: italic;
242}
243
244.token.entity {
245 cursor: help;
246}
247
248.token.namespace {
249 opacity: 0.8;
250}
251
252/* Plugin overrides */
253/* Selectors should have higher specificity than those in the plugins' default stylesheets */
254
255/* Show Invisibles plugin overrides */
256.token.token.tab:not(:empty):before,
257.token.token.cr:before,
258.token.token.lf:before,
259.token.token.space:before {
260 color: hsla(220, 14%, 71%, 0.15);
261 text-shadow: none;
262}
263
264/* Toolbar plugin overrides */
265/* Space out all buttons and move them away from the right edge of the code block */
266div.code-toolbar > .toolbar.toolbar > .toolbar-item {
267 margin-right: 0.4em;
268}
269
270/* Styling the buttons */
271div.code-toolbar > .toolbar.toolbar > .toolbar-item > button,
272div.code-toolbar > .toolbar.toolbar > .toolbar-item > a,
273div.code-toolbar > .toolbar.toolbar > .toolbar-item > span {
274 background: hsl(220, 13%, 26%);
275 color: hsl(220, 9%, 55%);
276 padding: 0.1em 0.4em;
277 border-radius: 0.3em;
278}
279
280div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover,
281div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus,
282div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover,
283div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus,
284div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover,
285div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus {
286 background: hsl(220, 13%, 28%);
287 color: hsl(220, 14%, 71%);
288}
289
290/* Line Highlight plugin overrides */
291/* The highlighted line itself */
292.line-highlight.line-highlight {
293 background: hsla(220, 100%, 80%, 0.04);
294}
295
296/* Default line numbers in Line Highlight plugin */
297.line-highlight.line-highlight:before,
298.line-highlight.line-highlight[data-end]:after {
299 background: hsl(220, 13%, 26%);
300 color: hsl(220, 14%, 71%);
301 padding: 0.1em 0.6em;
302 border-radius: 0.3em;
303 box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */
304}
305
306/* Hovering over a linkable line number (in the gutter area) */
307/* Requires Line Numbers plugin as well */
308pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before {
309 background-color: hsla(220, 100%, 80%, 0.04);
310}
311
312/* Line Numbers and Command Line plugins overrides */
313/* Line separating gutter from coding area */
314.line-numbers.line-numbers .line-numbers-rows,
315.command-line .command-line-prompt {
316 border-right-color: hsla(220, 14%, 71%, 0.15);
317}
318
319/* Stuff in the gutter */
320.line-numbers .line-numbers-rows > span:before,
321.command-line .command-line-prompt > span:before {
322 color: hsl(220, 14%, 45%);
323}
324
325/* Match Braces plugin overrides */
326/* Note: Outline colour is inherited from the braces */
327.rainbow-braces .token.token.punctuation.brace-level-1,
328.rainbow-braces .token.token.punctuation.brace-level-5,
329.rainbow-braces .token.token.punctuation.brace-level-9 {
330 color: hsl(355, 65%, 65%);
331}
332
333.rainbow-braces .token.token.punctuation.brace-level-2,
334.rainbow-braces .token.token.punctuation.brace-level-6,
335.rainbow-braces .token.token.punctuation.brace-level-10 {
336 color: hsl(95, 38%, 62%);
337}
338
339.rainbow-braces .token.token.punctuation.brace-level-3,
340.rainbow-braces .token.token.punctuation.brace-level-7,
341.rainbow-braces .token.token.punctuation.brace-level-11 {
342 color: hsl(207, 82%, 66%);
343}
344
345.rainbow-braces .token.token.punctuation.brace-level-4,
346.rainbow-braces .token.token.punctuation.brace-level-8,
347.rainbow-braces .token.token.punctuation.brace-level-12 {
348 color: hsl(286, 60%, 67%);
349}
350
351/* Diff Highlight plugin overrides */
352/* Taken from https://github.com/atom/github/blob/master/styles/variables.less */
353pre.diff-highlight > code .token.token.deleted:not(.prefix),
354pre > code.diff-highlight .token.token.deleted:not(.prefix) {
355 background-color: hsla(353, 100%, 66%, 0.15);
356}
357
358pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection,
359pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection,
360pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection,
361pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection {
362 background-color: hsla(353, 95%, 66%, 0.25);
363}
364
365pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection,
366pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection,
367pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection,
368pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection {
369 background-color: hsla(353, 95%, 66%, 0.25);
370}
371
372pre.diff-highlight > code .token.token.inserted:not(.prefix),
373pre > code.diff-highlight .token.token.inserted:not(.prefix) {
374 background-color: hsla(137, 100%, 55%, 0.15);
375}
376
377pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection,
378pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection,
379pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection,
380pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection {
381 background-color: hsla(135, 73%, 55%, 0.25);
382}
383
384pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection,
385pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection,
386pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection,
387pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection {
388 background-color: hsla(135, 73%, 55%, 0.25);
389}
390
391/* Previewers plugin overrides */
392/* Based on https://github.com/atom-community/atom-ide-datatip/blob/master/styles/atom-ide-datatips.less and https://github.com/atom/atom/blob/master/packages/one-dark-ui */
393/* Border around popup */
394.prism-previewer.prism-previewer:before,
395.prism-previewer-gradient.prism-previewer-gradient div {
396 border-color: hsl(224, 13%, 17%);
397}
398
399/* Angle and time should remain as circles and are hence not included */
400.prism-previewer-color.prism-previewer-color:before,
401.prism-previewer-gradient.prism-previewer-gradient div,
402.prism-previewer-easing.prism-previewer-easing:before {
403 border-radius: 0.3em;
404}
405
406/* Triangles pointing to the code */
407.prism-previewer.prism-previewer:after {
408 border-top-color: hsl(224, 13%, 17%);
409}
410
411.prism-previewer-flipped.prism-previewer-flipped.after {
412 border-bottom-color: hsl(224, 13%, 17%);
413}
414
415/* Background colour within the popup */
416.prism-previewer-angle.prism-previewer-angle:before,
417.prism-previewer-time.prism-previewer-time:before,
418.prism-previewer-easing.prism-previewer-easing {
419 background: hsl(219, 13%, 22%);
420}
421
422/* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */
423/* For time, this is the alternate colour */
424.prism-previewer-angle.prism-previewer-angle circle,
425.prism-previewer-time.prism-previewer-time circle {
426 stroke: hsl(220, 14%, 71%);
427 stroke-opacity: 1;
428}
429
430/* Stroke colours of the handle, direction point, and vector itself */
431.prism-previewer-easing.prism-previewer-easing circle,
432.prism-previewer-easing.prism-previewer-easing path,
433.prism-previewer-easing.prism-previewer-easing line {
434 stroke: hsl(220, 14%, 71%);
435}
436
437/* Fill colour of the handle */
438.prism-previewer-easing.prism-previewer-easing circle {
439 fill: transparent;
440}