MediaWiki:Gadget-code-prettify.css
注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:前往菜单 → 设置(Mac为Opera → Preferences),然后隐私和安全 → 清除浏览数据 → 缓存的图片和文件。
/* https://github.com/google/code-prettify/blob/master/src/prettify.css */
/**
* @license
* Copyright (C) 2015 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.pln {
color: #000;
}
@media screen {
.str {
color: #080;
}
.kwd {
color: #008;
}
.com {
color: #800;
}
.typ {
color: #606;
}
.lit {
color: #066;
}
.pun,
.opn,
.clo {
color: #660;
}
.tag {
color: #008;
}
.atn {
color: #606;
}
.atv {
color: #080;
}
.dec,
.var {
color: #606;
}
.fun {
color: red;
}
}
@media print,
projection {
.str {
color: #060;
}
.kwd {
color: #006;
font-weight: bold;
}
.com {
color: #600;
font-style: italic;
}
.typ {
color: #404;
font-weight: bold;
}
.lit {
color: #044;
}
.pun,
.opn,
.clo {
color: #440;
}
.tag {
color: #006;
font-weight: bold;
}
.atn {
color: #404;
}
.atv {
color: #060;
}
}
pre.prettyprint {
padding: 2px;
border: 1px solid #888;
}
ol.linenums {
margin-top: 0;
margin-bottom: 0;
}
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee;
}
li.linenums-active {
background-color: #fff8c5;
box-shadow: inset 2px 0 0 #d4a72c66;
}
/* 优化移动端代码显示 */
.skin-minerva pre.prettyprint {
white-space: pre;
overflow-x: auto;
}
.skin-minerva pre.prettyprint li {
margin-bottom: 0;
}
.skin-minerva ol.linenums {
width: max-content;
min-width: 100%;
}