Skip to content

Commit d5d2784

Browse files
committed
clean up code blocks css
1 parent 16e3da2 commit d5d2784

File tree

2 files changed

+74
-90
lines changed

2 files changed

+74
-90
lines changed

site/_css/graphql.less

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,37 @@ p + .apiIndex {
673673
margin-bottom: 0;
674674
}
675675

676+
.apiIndex pre {
677+
.code-font();
678+
text-shadow: 0 1px white;
679+
direction: ltr;
680+
text-align: left;
681+
white-space: pre;
682+
word-spacing: normal;
683+
word-break: normal;
684+
685+
-moz-tab-size: 2;
686+
-o-tab-size: 2;
687+
tab-size: 2;
688+
689+
-webkit-hyphens: none;
690+
-moz-hyphens: none;
691+
-ms-hyphens: none;
692+
hyphens: none;
693+
694+
white-space: pre-wrap;
695+
}
696+
697+
.apiIndex li {
698+
font-size: 13px;
699+
line-height: 17px;
700+
padding: 7px 14px;
701+
background: white;
702+
box-shadow: inset 0 0 0 1px #EEE, inset 4px 0 0 #EEE;
703+
border-radius: 3px;
704+
margin-left: -4px;
705+
}
706+
676707
@media screen and (max-width: 1020px) {
677708
.nav-main {
678709
position: static;
@@ -711,11 +742,6 @@ p + .apiIndex {
711742
.hero {
712743
padding: 10px 0 30px 0;
713744
}
714-
.prism {
715-
padding: 4px 8px;
716-
margin-left: -12px;
717-
font-size: 11px;
718-
}
719745
.nav-docs .nav-docs-section {
720746
border: none;
721747
padding: 0;

site/_css/prism.less

Lines changed: 43 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
@import "variables.less";
22

3-
/* http://prismjs.com/download.html?themes=prism&languages=markup+clike+javascript+jsx */
4-
/**
5-
* prism.js default theme for JavaScript, CSS and HTML
6-
* Based on dabblet (http://dabblet.com)
7-
* @author Lea Verou
8-
*/
9-
10-
code[class*="language-"],
11-
pre[class*="language-"],
12-
.apiIndex pre {
3+
.prism {
4+
position: relative;
5+
6+
@media screen and (max-width: 1020px) {
7+
padding: 4px 8px;
8+
margin-left: -12px;
9+
font-size: 11px;
10+
}
11+
12+
@media print {
13+
text-shadow: none;
14+
}
15+
}
16+
17+
.prism + .prism {
18+
margin-top: -15px;
19+
}
20+
21+
.prism {
1322
.code-font();
1423
text-shadow: 0 1px white;
1524
direction: ltr;
@@ -26,45 +35,40 @@ pre[class*="language-"],
2635
-moz-hyphens: none;
2736
-ms-hyphens: none;
2837
hyphens: none;
29-
}
3038

31-
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
32-
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
33-
text-shadow: none;
34-
background: #b3d4fc;
35-
}
39+
white-space: pre-wrap;
3640

37-
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
38-
code[class*="language-"]::selection, code[class*="language-"] ::selection {
39-
text-shadow: none;
40-
background: #b3d4fc;
41-
}
41+
font-size: 13px;
42+
line-height: 17px;
43+
background: white;
44+
box-shadow: inset 0 0 0 1px #EEE, inset 4px 0 0 #EEE;
45+
border-radius: 3px;
4246

43-
@media print {
44-
code[class*="language-"],
45-
pre[class*="language-"] {
47+
.line-highlight {
48+
background-color: rgba(229, 53, 171, 0.15);
49+
left: 0;
50+
line-height: inherit;
51+
margin-top: 5px;
52+
pointer-events: none;
53+
position: absolute;
54+
right: 0;
55+
}
56+
57+
::-moz-selection, ::selection {
4658
text-shadow: none;
59+
background: #b3d4fc;
4760
}
4861
}
4962

50-
/* Code blocks */
51-
pre[class*="language-"] {
52-
padding: 1em;
53-
margin: .5em 0;
63+
// Code blocks
64+
pre.prism {
65+
padding: 7px 14px;
66+
margin-left: -4px;
67+
margin-bottom: 10px;
5468
overflow: auto;
5569
}
5670

57-
:not(pre) > code[class*="language-"],
58-
pre[class*="language-"] {
59-
background: #f5f2f0;
60-
}
61-
62-
/* Inline code */
63-
:not(pre) > code[class*="language-"] {
64-
padding: .1em;
65-
border-radius: .3em;
66-
}
67-
71+
// Colors
6872
.token.comment,
6973
.token.prolog,
7074
.token.doctype,
@@ -135,49 +139,3 @@ pre[class*="language-"] {
135139
.token.entity {
136140
cursor: help;
137141
}
138-
139-
/* Custom prism rules for the GraphQL docs */
140-
141-
code[class*="language-"],
142-
pre[class*="language-"] {
143-
margin-bottom: 10px;
144-
}
145-
code[class*="language-"],
146-
pre[class*="language-"],
147-
.apiIndex pre {
148-
.code-font();
149-
white-space: pre-wrap;
150-
}
151-
152-
code[class*="language-"],
153-
pre[class*="language-"],
154-
.apiIndex li {
155-
font-size: 13px;
156-
line-height: 17px;
157-
padding: 7px 14px;
158-
background: white;
159-
box-shadow: inset 0 0 0 1px #EEE, inset 4px 0 0 #EEE;
160-
border-radius: 3px;
161-
margin-left: -4px;
162-
}
163-
164-
.prism + .prism {
165-
margin-top: -15px;
166-
}
167-
168-
/* Line highlighting */
169-
170-
.prism {
171-
position: relative;
172-
}
173-
174-
.line-highlight {
175-
background-color: rgba(229, 53, 171, 0.15);
176-
left: 0;
177-
line-height: inherit;
178-
margin-top: 5px;
179-
pointer-events: none;
180-
position: absolute;
181-
right: 0;
182-
}
183-

0 commit comments

Comments
 (0)