- 欢迎加入官方Discord和Telegram群组!
- 我们正在删除政治内容页面,还您一个干净的H萌娘,净化社区的同时也可以让您认真学习和讨论性知识(?
- 不知道接下来该看什么?可以去查阅本站的优质条目
- 如果您在H萌娘上发现某些内容错误/空缺,请勇于修正/添加!编辑H萌娘其实很容易!(由于遭到破坏,自动确认用户外的编辑现在会先审核 )
- 有任何意见、建议、求助都可以在 讨论版 提出!
MediaWiki:Gadget-code-prettify.css
跳到导航
跳到搜索
注意:这类代码页面在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- 按住
CTRL+SHIFT+DEL 或 ⌘-Shift-R
来清除缓存! - 或尝试在地址栏的地址最后添加代码
?_=1
来访问最新页面。 - 你还可以在设置中勾选小工具在页面右上角添加清除缓存按钮!
/* <nowiki> */
/**
* @Source: https://llwiki.org/zh/mediawiki:Gadget-code-prettify.css
* @Author: User:Bhsd
* @License: CC BY-NC-SA 4.0
*/
/* 1. 语法高亮,参考自[[mw:Extension:SyntaxHighlight]],以下按色调排序 */
.hljs-literal,
.hljs-number {
color: #a2f;
}
.hljs-regexp,
.hljs-selector-pseudo {
color: #b68;
}
.hljs-subst { /* JS模板字符串 */
color: #b68;
font-weight: bold;
}
.hljs-string {
color: #ba2121;
}
.hljs-meta { /* JS的strict模式和CSS的!important */
color: #cb4b16;
}
.hljs-type,
.hljs-variable { /* JS文档的参数类型和名称 */
color: #b58900;
font-weight: normal;
font-style: normal;
}
.hljs-attribute { /* CSS属性 */
color: #b58900;
font-weight: bold;
}
.hljs-attr { /* JS对象键值 */
color: #7d9029;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-doctag,
.hljs-name { /* HTML的tag名称 */
color: #008000;
font-weight: bold;
font-style: normal;
}
.hljs-comment {
color: #408080;
font-style: italic;
font-weight: normal;
}
.hljs-title, /* 声明的JS函数名 */
.hljs-selector-attr {
color: #268bd2;
}
.hljs-selector-class,
.hljs-built_in { /* JS内置变量、CSS内置函数 */
color: #00f;
}
.hljs-selector-id {
color: #00f;
font-weight: bold;
}
/* 2. 标注颜色,仅支持16进制和rgb/rgba */
.hljs-color {
vertical-align: text-bottom;
}
.hljs-color::after {
content: "⬤ "; /* Safari */
font-size: 0.75em;
text-shadow: 0 0 1px #000;
}
/* 3. 代码块 */
.highlighted {
padding: 1px 4px; /* 同<code> */
}
.skin-minerva .highlighted {
padding: 0.2em 0.5em; /* 同<code> */
}
.highlighted.linenums {
padding: 0;
border-color: #c8ccd1; /* 桌面版略微加深边框颜色以适应底色 */
}
.linenums ol {
margin: 0 !important; /* 仿照手机版移除margin,并由JS指定padding-left */
list-style-position: outside;
}
@media only screen and (max-width:720px) { /* 窄屏隐藏行号 */
.linenums ol {
padding-left: 0 !important;
list-style-type: none; /* 仅供参考:萌百选择了list-style-position: inside; */
}
}
pre.linenums li {
padding: 0 4px;
margin-bottom: 0; /* 保证交错底色等宽 */
line-height: 1.5;
}
.linenums li:nth-child(2n) {
background-color: #eee;
}
.linenums li:empty::before {
content: ""; /* 撑行高 */
display: inline-block;
}
/* </nowiki> */