UNPKG

4.09 kBCSSView Raw
1/**
2 * prism.js Twilight theme
3 * Based (more or less) on the Twilight theme originally of Textmate fame.
4 * @author Remy Bach
5 */
6code[class*="language-"],
7pre[class*="language-"] {
8 color: white;
9 background: none;
10 font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
11 text-align: left;
12 text-shadow: 0 -.1em .2em black;
13 white-space: pre;
14 word-spacing: normal;
15 word-break: normal;
16 word-wrap: normal;
17 line-height: 1.5;
18
19 -moz-tab-size: 4;
20 -o-tab-size: 4;
21 tab-size: 4;
22
23 -webkit-hyphens: none;
24 -moz-hyphens: none;
25 -ms-hyphens: none;
26 hyphens: none;
27}
28
29pre[class*="language-"],
30:not(pre) > code[class*="language-"] {
31 background: hsl(0, 0%, 8%); /* #141414 */
32}
33
34/* Code blocks */
35pre[class*="language-"] {
36 border-radius: .5em;
37 border: .3em solid hsl(0, 0%, 33%); /* #282A2B */
38 box-shadow: 1px 1px .5em black inset;
39 margin: .5em 0;
40 overflow: auto;
41 padding: 1em;
42}
43
44pre[class*="language-"]::-moz-selection {
45 /* Firefox */
46 background: hsl(200, 4%, 16%); /* #282A2B */
47}
48
49pre[class*="language-"]::selection {
50 /* Safari */
51 background: hsl(200, 4%, 16%); /* #282A2B */
52}
53
54/* Text Selection colour */
55pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
56code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
57 text-shadow: none;
58 background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */
59}
60
61pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
62code[class*="language-"]::selection, code[class*="language-"] ::selection {
63 text-shadow: none;
64 background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */
65}
66
67/* Inline code */
68:not(pre) > code[class*="language-"] {
69 border-radius: .3em;
70 border: .13em solid hsl(0, 0%, 33%); /* #545454 */
71 box-shadow: 1px 1px .3em -.1em black inset;
72 padding: .15em .2em .05em;
73 white-space: normal;
74}
75
76.token.comment,
77.token.prolog,
78.token.doctype,
79.token.cdata {
80 color: hsl(0, 0%, 47%); /* #777777 */
81}
82
83.token.punctuation {
84 opacity: .7;
85}
86
87.namespace {
88 opacity: .7;
89}
90
91.token.tag,
92.token.boolean,
93.token.number,
94.token.deleted {
95 color: hsl(14, 58%, 55%); /* #CF6A4C */
96}
97
98.token.keyword,
99.token.property,
100.token.selector,
101.token.constant,
102.token.symbol,
103.token.builtin {
104 color: hsl(53, 89%, 79%); /* #F9EE98 */
105}
106
107.token.attr-name,
108.token.attr-value,
109.token.string,
110.token.char,
111.token.operator,
112.token.entity,
113.token.url,
114.language-css .token.string,
115.style .token.string,
116.token.variable,
117.token.inserted {
118 color: hsl(76, 21%, 52%); /* #8F9D6A */
119}
120
121.token.atrule {
122 color: hsl(218, 22%, 55%); /* #7587A6 */
123}
124
125.token.regex,
126.token.important {
127 color: hsl(42, 75%, 65%); /* #E9C062 */
128}
129
130.token.important,
131.token.bold {
132 font-weight: bold;
133}
134.token.italic {
135 font-style: italic;
136}
137
138.token.entity {
139 cursor: help;
140}
141
142pre[data-line] {
143 padding: 1em 0 1em 3em;
144 position: relative;
145}
146
147/* Markup */
148.language-markup .token.tag,
149.language-markup .token.attr-name,
150.language-markup .token.punctuation {
151 color: hsl(33, 33%, 52%); /* #AC885B */
152}
153
154/* Make the tokens sit above the line highlight so the colours don't look faded. */
155.token {
156 position: relative;
157 z-index: 1;
158}
159
160.line-highlight {
161 background: hsla(0, 0%, 33%, 0.25); /* #545454 */
162 background: linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */
163 border-bottom: 1px dashed hsl(0, 0%, 33%); /* #545454 */
164 border-top: 1px dashed hsl(0, 0%, 33%); /* #545454 */
165 left: 0;
166 line-height: inherit;
167 margin-top: 0.75em; /* Same as .prism’s padding-top */
168 padding: inherit 0;
169 pointer-events: none;
170 position: absolute;
171 right: 0;
172 white-space: pre;
173 z-index: 0;
174}
175
176.line-highlight:before,
177.line-highlight[data-end]:after {
178 background-color: hsl(215, 15%, 59%); /* #8794A6 */
179 border-radius: 999px;
180 box-shadow: 0 1px white;
181 color: hsl(24, 20%, 95%); /* #F5F2F0 */
182 content: attr(data-start);
183 font: bold 65%/1.5 sans-serif;
184 left: .6em;
185 min-width: 1em;
186 padding: 0 .5em;
187 position: absolute;
188 text-align: center;
189 text-shadow: none;
190 top: .4em;
191 vertical-align: .3em;
192}
193
194.line-highlight[data-end]:after {
195 bottom: .4em;
196 content: attr(data-end);
197 top: auto;
198}