UNPKG

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