Use the OS' native font by default
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / style / bbcode / code.scss
CommitLineData
c947cf5f 1.redactor-layer pre {
97f8f467 2 background-color: rgb(255, 255, 255) !important;
8a52619a 3 box-shadow: 0 0 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
97f8f467
AE
4 border-radius: 2px;
5 color: rgb(68, 68, 68) !important;
cf12aedd 6 font-family: $wcfFontFamilyMonospace;
97f8f467
AE
7 margin: 1em 0;
8 padding: 10px 20px;
9 position: relative;
2ef6247c
AE
10 white-space: pre-wrap;
11 word-break: break-all;
12 word-wrap: break-word;
8a52619a 13
3d9f265d
AE
14 &:not(.redactorCalcHeight)::before,
15 &.woltlabHtml::before {
333f26a7 16 color: $wcfContentLink;
97e54d27 17 content: attr(data-title);
7b83aa87 18 cursor: pointer;
97f8f467
AE
19 display: block;
20 font-family: $wcfFontFamily;
21 margin-bottom: 20px;
8a52619a 22
97f8f467
AE
23 @include wcfFontHeadline;
24 }
8a52619a 25
3d9f265d
AE
26 &.woltlabHtml {
27 &::before {
28 margin-bottom: 30px;
29 }
8a52619a 30
3d9f265d
AE
31 &::after {
32 color: $wcfContentDimmedText;
33 content: attr(data-description);
34 cursor: pointer;
35 display: block;
36 font-family: $wcfFontFamily;
37 position: absolute;
38 top: 32px;
8a52619a 39
3d9f265d
AE
40 @include wcfFontSmall;
41 }
42 }
97f8f467 43}
442a3ea1
AE
44
45.codeBox {
46 background-color: $wcfContentBackground;
8a52619a 47 box-shadow: 0 0 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
442a3ea1 48 border-radius: 2px;
9e8632c0 49 clear: both;
0663e9fb 50 margin: 1em 0;
442a3ea1 51 padding: 10px;
ce04ba92 52 position: relative;
8a52619a 53
ce04ba92 54 &.collapsed {
e587215c
TD
55 .codeBoxCode {
56 max-height: 200px;
57 overflow: hidden;
58 }
8a52619a 59
ce04ba92
AE
60 > .toggleButton {
61 bottom: 0;
ce04ba92
AE
62 left: 0;
63 padding-bottom: 10px;
64 position: absolute;
65 right: 0;
39eaca6d 66 z-index: 1;
8a52619a 67
c02d0e01 68 &::before {
8a52619a
TD
69 background-image: linear-gradient(
70 to top,
71 opacify($wcfContentBackground, 0.9),
72 transparentize($wcfContentBackground, 1)
73 );
c02d0e01
AE
74 content: "";
75 height: 60px;
76 left: 0;
77 pointer-events: none;
78 position: absolute;
79 right: 0;
80 top: -60px;
81 }
ce04ba92
AE
82 }
83 }
8a52619a 84
e587215c
TD
85 .codeBoxHeader {
86 position: sticky;
87 top: 50px;
88 z-index: 1;
89 padding: 10px 10px 10px;
90 margin: -10px -10px 0;
91 background-color: $wcfContentBackground;
8a52619a 92
e587215c
TD
93 align-items: center;
94 display: flex;
8a52619a 95
e587215c
TD
96 /* required to avoid layout jumping caused by the dynamically added 24px button */
97 min-height: 24px;
8a52619a 98
e587215c
TD
99 > .codeBoxHeadline {
100 flex: 1 1 auto;
101 padding: 0 10px;
8a52619a 102
e587215c 103 @include wcfFontHeadline;
c59d8cbe
AE
104
105 @include screen-sm-down {
106 overflow: auto;
107 white-space: nowrap;
108 }
109 }
110
111 .icon {
112 flex: 0 0 auto;
ce04ba92 113 }
e587215c 114 }
8a52619a 115
e587215c
TD
116 .codeBoxCode {
117 position: relative;
118 padding-left: 7ch;
8a52619a 119
e587215c
TD
120 > code {
121 display: block;
122 overflow-x: auto;
cf12aedd 123 font-family: $wcfFontFamilyMonospace;
8a52619a 124
e587215c 125 .codeBoxLine {
1149a775 126 display: block;
8a52619a 127
e587215c
TD
128 > a {
129 margin-left: -7ch;
130 overflow: hidden;
131 position: absolute;
132 text-align: right;
133 text-overflow: ellipsis;
134 white-space: nowrap;
135 /* No one has line numbers greater than 999999 */
136 width: 6ch;
8a52619a 137
e587215c
TD
138 &::before {
139 content: attr(title);
070c42e0
TD
140 }
141 }
8a52619a 142
e587215c
TD
143 > span {
144 white-space: pre-wrap;
145 word-break: break-all;
146 }
8a52619a 147
e587215c
TD
148 &:target {
149 background-color: rgba(255, 255, 102, 1);
150 }
442a3ea1
AE
151 }
152 }
153 }
8a52619a 154
ce04ba92 155 > .toggleButton {
8a52619a 156 background-color: opacify($wcfContentBackground, 0.9);
ce04ba92
AE
157 cursor: pointer;
158 display: block;
159 padding: 10px 20px 0 10px;
160 text-align: center;
8a52619a 161
ce04ba92
AE
162 @include wcfFontSmall;
163 }
442a3ea1
AE
164}
165
e587215c
TD
166.anchorFixedHeader:not(.disableAnchorFixedHeader):target .codeBoxHeader {
167 top: -30px; /* see wsc31.scss */
168}
169
13a849f3
AE
170.dialogContent .codeBox .codeBoxHeader {
171 /* Prevent the header being sticky inside dialogs, which doesn't really work. */
172 position: static;
173}
174
070c42e0
TD
175/* PrismJS 1.15.0
176https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript&plugins=autoloader */
177/**
178 * prism.js default theme for JavaScript, CSS and HTML
179 * Based on dabblet (http://dabblet.com)
180 * @author Lea Verou
181 */
8a52619a
TD
182
183.token.comment,
184.token.prolog,
185.token.doctype,
186.token.cdata {
187 color: slategray;
188}
189
190.token.punctuation {
191 color: #999;
192}
193
194.namespace {
195 opacity: 0.7;
196}
197
198.token.property,
199.token.tag,
200.token.boolean,
201.token.number,
202.token.constant,
203.token.symbol,
204.token.deleted {
205 color: #905;
206}
207
208.token.selector,
209.token.attr-name,
210.token.string,
211.token.char,
212.token.builtin,
213.token.inserted {
214 color: #690;
215}
216
217.token.operator,
218.token.entity,
219.token.url,
220.language-css .token.string,
221.style .token.string {
222 color: #9a6e3a;
223 background: hsla(0, 0%, 100%, 0.5);
224}
225
226.token.atrule,
227.token.attr-value,
228.token.keyword {
229 color: #07a;
230}
231
232.token.function,
233.token.class-name {
234 color: #dd4a68;
235}
236
237.token.regex,
238.token.important,
239.token.variable {
240 color: #e90;
241}
242
243.token.important,
244.token.bold {
245 font-weight: 600;
246}
247.token.italic {
248 font-style: italic;
249}
250
251.token.entity {
252 cursor: help;
253}