UNPKG

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