2020-12-30 15:31:33 +00:00
|
|
|
.mw-highlight {
|
|
|
|
/* All supported programming languages are written left-to-right */
|
|
|
|
/* @noflip */
|
|
|
|
direction: ltr;
|
|
|
|
unicode-bidi: embed;
|
2021-01-03 00:18:48 +00:00
|
|
|
position: relative;
|
2020-12-30 15:31:33 +00:00
|
|
|
|
|
|
|
pre {
|
|
|
|
/* Use a more commonly found tab size of 4 (e.g. as used in CodeEditor)
|
|
|
|
instead of the browser-default value of 8 */
|
|
|
|
-moz-tab-size: 4;
|
|
|
|
-o-tab-size: 4;
|
|
|
|
tab-size: 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Avoid displaying double borders for nested 'code' elements.
|
|
|
|
Before we started using the 'code' tag for inline code snippets,
|
|
|
|
<code><syntaxhighlight enclose=none ...>...</syntaxhighlight></code>
|
|
|
|
was a common pattern. Continue supporting it in existing content. */
|
|
|
|
code code& {
|
|
|
|
background-color: transparent;
|
|
|
|
border: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The nested pre already has a background. T126010 */
|
|
|
|
div& {
|
|
|
|
background-color: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Don't show a red border around syntax errors. This behavior may be useful
|
|
|
|
* in code editors, but it is not useful in a wiki environment, especially
|
|
|
|
* given the longstanding habit of using an existing, mostly-compatible lexer
|
|
|
|
* to highlight a language for which no lexer exists.
|
|
|
|
*/
|
|
|
|
.err {
|
|
|
|
border: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Highlight background of whole lines, not just text in them */
|
|
|
|
.hll {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
2021-01-01 16:42:55 +00:00
|
|
|
&-lines pre,
|
|
|
|
.content &-lines pre { // Increase specificty over mobile selectors
|
2020-12-30 20:57:24 +00:00
|
|
|
padding-left: 3.5em;
|
|
|
|
box-shadow: inset 2.75em 0 0 #f0f0f0;
|
2021-01-01 19:54:48 +00:00
|
|
|
|
|
|
|
.hll {
|
|
|
|
margin-left: -3.5em;
|
|
|
|
padding-left: 3.5em;
|
|
|
|
}
|
2020-12-30 20:57:24 +00:00
|
|
|
}
|
|
|
|
|
2020-12-30 15:05:34 +00:00
|
|
|
.linenos {
|
2020-12-30 20:57:24 +00:00
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
box-sizing: border-box;
|
|
|
|
width: 2.75em;
|
|
|
|
text-align: right;
|
2020-12-30 15:25:11 +00:00
|
|
|
margin-right: 4px;
|
2020-12-30 20:57:24 +00:00
|
|
|
background: none;
|
|
|
|
color: #333;
|
|
|
|
white-space: pre;
|
2020-12-30 15:25:11 +00:00
|
|
|
/* Make line numbers non copyable */
|
2020-12-30 14:43:27 +00:00
|
|
|
/* TODO: This only exists for cached output and should be removed eventually */
|
2020-12-30 15:31:33 +00:00
|
|
|
-moz-user-select: none;
|
|
|
|
-webkit-user-select: none;
|
|
|
|
-ms-user-select: none;
|
|
|
|
user-select: none;
|
2020-12-30 14:43:27 +00:00
|
|
|
|
|
|
|
&:before {
|
|
|
|
content: attr( data-line );
|
|
|
|
}
|
2020-12-30 15:31:33 +00:00
|
|
|
}
|
|
|
|
|
2021-01-01 19:48:57 +00:00
|
|
|
a:hover .linenos {
|
|
|
|
color: #808080;
|
|
|
|
}
|
|
|
|
|
2020-12-30 15:31:33 +00:00
|
|
|
/* To interact better with the 'display: block' above, doesn't affect other uses */
|
|
|
|
/* @noflip */
|
2020-12-30 15:05:34 +00:00
|
|
|
&.mw-content-ltr .linenos {
|
2020-12-30 15:31:33 +00:00
|
|
|
float: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* @noflip */
|
2020-12-30 15:05:34 +00:00
|
|
|
&.mw-content-rtl .linenos {
|
2020-12-30 15:31:33 +00:00
|
|
|
float: right;
|
|
|
|
}
|
|
|
|
}
|