本帖最后由 老刘1号 于 2023-8-29 19:04 编辑
回复 6# Nsqs
可以用这个bailong360之前写的油猴脚本自定义颜色- // ==UserScript==
- // @name bathome 代码高亮主题
- // @namespace http://userstyles.org
- // @description bathome 代码高亮主题, 默认为 Atom One Dark
- // @author aloxaf
- // @homepage https://userstyles.org/styles/176869
- // @include http://bathome.net/*
- // @include https://bathome.net/*
- // @include http://*.bathome.net/*
- // @include https://*.bathome.net/*
- // @include http://bathome.net/*
- // @include https://bathome.net/*
- // @include http://*.bathome.net/*
- // @include https://*.bathome.net/*
- // @run-at document-start
- // @version 0.20191103025706
- // ==/UserScript==
- (function() {var css = "";
- if (false || (document.domain == "bathome.net" || document.domain.substring(document.domain.indexOf(".bathome.net") + 1) == "bathome.net"))
- css += [
- "/* 高亮主题 */",
- "/*",
- "Atom One Dark by Daniel Gamage",
- "Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax",
- "base: #282c34",
- "mono-1: #abb2bf",
- "mono-2: #818896",
- "mono-3: #5c6370",
- "hue-1: #56b6c2",
- "hue-2: #61aeee",
- "hue-3: #c678dd",
- "hue-4: #98c379",
- "hue-5: #e06c75",
- "hue-5-2: #be5046",
- "hue-6: #d19a66",
- "hue-6-2: #e6c07b",
- "*/",
- "",
- ".hljs {",
- " display: block;",
- " overflow-x: auto;",
- " padding: 0.5em;",
- " color: #abb2bf;",
- " background: #282c34;",
- "}",
- "",
- ".hljs-comment,",
- ".hljs-quote {",
- " color: #5c6370;",
- " font-style: italic;",
- "}",
- "",
- ".hljs-doctag,",
- ".hljs-keyword,",
- ".hljs-formula {",
- " color: #c678dd;",
- "}",
- "",
- ".hljs-section,",
- ".hljs-name,",
- ".hljs-selector-tag,",
- ".hljs-deletion,",
- ".hljs-subst {",
- " color: #e06c75;",
- "}",
- "",
- ".hljs-literal {",
- " color: #56b6c2;",
- "}",
- "",
- ".hljs-string,",
- ".hljs-regexp,",
- ".hljs-addition,",
- ".hljs-attribute,",
- ".hljs-meta-string {",
- " color: #98c379;",
- "}",
- "",
- ".hljs-built_in,",
- ".hljs-class .hljs-title {",
- " color: #e6c07b;",
- "}",
- "",
- ".hljs-attr,",
- ".hljs-variable,",
- ".hljs-template-variable,",
- ".hljs-type,",
- ".hljs-selector-class,",
- ".hljs-selector-attr,",
- ".hljs-selector-pseudo,",
- ".hljs-number {",
- " color: #d19a66;",
- "}",
- "",
- ".hljs-symbol,",
- ".hljs-bullet,",
- ".hljs-link,",
- ".hljs-meta,",
- ".hljs-selector-id,",
- ".hljs-title {",
- " color: #61aeee;",
- "}",
- "",
- ".hljs-emphasis {",
- " font-style: italic;",
- "}",
- "",
- ".hljs-strong {",
- " font-weight: bold;",
- "}",
- "",
- ".hljs-link {",
- " text-decoration: underline;",
- "}"
- ].join("\n");
- if (false || (document.domain == "bathome.net" || document.domain.substring(document.domain.indexOf(".bathome.net") + 1) == "bathome.net"))
- css += [
- "/* 行号等玩意儿的处理 */",
- ".hljs-ln {",
- " table-layout: unset !important;",
- "}",
- "",
- ".hljs-ln-line {",
- " font-size: 12px !important;",
- "}",
- "",
- ".hljs-ln-code {",
- " color: unset;",
- " font-family: monospace;",
- " width: 100%;",
- "}",
- "",
- "/* for block of numbers */",
- ".hljs-ln-numbers {",
- " -webkit-touch-callout: none;",
- " -webkit-user-select: none;",
- " -khtml-user-select: none;",
- " -moz-user-select: none;",
- " -ms-user-select: none;",
- " user-select: none;",
- "",
- " text-align: center;",
- " color: #ccc;",
- " border-right: 1px solid #CCC;",
- " vertical-align: top;",
- " padding-right: 5px !important;",
- "",
- " /* your custom style here */",
- "}",
- "",
- "/* for block of code */",
- ".hljs-ln-code {",
- " padding-left: 10px !important;",
- "}"
- ].join("\n");
- if (typeof GM_addStyle != "undefined") {
- GM_addStyle(css);
- } else if (typeof PRO_addStyle != "undefined") {
- PRO_addStyle(css);
- } else {
- var node = document.createElement("style");
- node.type = "text/css";
- node.appendChild(document.createTextNode(css));
- var heads = document.getElementsByTagName("head");
- if (heads.length > 0) {
- heads[0].appendChild(node);
- } else {
- // no head yet, stick it whereever
- document.documentElement.appendChild(node);
- }
- }
- })();
复制代码
|