为知笔记网页端样式

为知笔记网页端样式之docker版本

// ==UserScript==
// @name         为知笔记网页端样式
// @namespace    https://fengwenhua.top/
// @version      0.1
// @description  为知笔记网页端样式之docker版本
// @author       江南小虫虫
// @match        http://xx.xx.xx.xx/*
// @icon         https://www.google.com/s2/favicons?domain=www.wiz.cn
// ==/UserScript==

(function() {
    var css = [
        ".editor-main {",
        "  font-size: 16px;",
        "  line-height: 1.8em;",
        "  letter-spacing: 0.1em;",
        "  --editor-code-bg-color:#F5F5F5;",
        "}",
        ".editor-main .root-container .code-line-block.editor-block * {",
        "  font-size: 14px;",
        "  font-family: Roboto, 'HYQihei 45S', Consolas, Inconsolata, Courier, monospace;",
        "}",
        ".editor-main .root-container .code-line-block.editor-block * {",
        "  border-radius: 2px;",
        "  font-size: 15px;",
        "  line-height: 1.4em;",
        "}",
        ".editor-main .root-container .code-block.editor-block {",
        "  border-radius: 3px;",
        "}",
        "/*加粗*/",
        ".editor-main .root-container .editor-block .style-bold{",
        "  color: #BF360C !important;",
        "}",
        "/*斜体*/",
        ".editor-main .root-container .editor-block .style-italic{",
        "  color: #009688;",
        "}",
        ".editor-main .root-container .embed-block hr.editor-embed {",
        "  border: 1px solid #BF360C;",
        "  margin: 1.5em auto;",
        "}",
        "/*代码编辑框*/",
        ".editor-main .editor-block {",
        "  margin-top: 0.5em !important;",
        "  margin-bottom: 0.5em !important;",
        "}",
        ".editor-main .editor-block.editor-quote-block,",
        ".editor-main .editor-block.list-block{",
        "  margin-top: 10px !important;",
        "  margin-bottom: 10px !important;",
        "}",
        "/*引用*/",
        ".editor-main .editor-block.editor-quote-block .block-content {",
        "  border-left: 2px solid #009688;",
        "  padding: 0 10px;",
        "  color: #777;",
        "  quotes: none;",
        "  margin-left: 1em;",
        "}",
        ".editor-main .editor-block.editor-quote-block + .editor-quote-block .block-content {",
        "  margin-top: -10px;",
        "}",
        "/*标题*/",
        ".editor-main h1.editor-block,",
        ".editor-main h2.editor-block,",
        ".editor-main h3.editor-block,",
        ".editor-main h4.editor-block,",
        ".editor-main h5.editor-block,",
        ".editor-main h6.editor-block {",
        "  margin-top: 20px;",
        "  margin-bottom: 10px;",
        "  font-style: bold !important;",
        "  color: #009688 !important;",
        "  text-align: center !important;",
        "  margin: 1.5em 5px !important;",
        "  padding: 0.5em 1em !important;",
        "}",
        ".editor-main h1.editor-block {",
        "  font-size: 26px !important;",
        "  border-bottom: 1px solid #ddd !important;",
        "}",
        ".editor-main h2.editor-block {",
        "  font-size: 20px !important;",
        "  border-bottom: 1px solid #eee !important;",
        "}",
        ".editor-main h3.editor-block {",
        "  font-size: 18px;",
        "}",
        ".editor-main h4.editor-block {",
        "  font-size: 16px;",
        "}",
        "/*表格*/",
        ".editor-main .editor-block.table-block table {",
        "  padding: 0;",
        "  border-collapse: collapse;",
        "  border-spacing: 0;",
        "  font-size: 1em;",
        "  font: inherit;",
        "  border: 0;",
        "  margin: 0;",
        "}",
        ".editor-main .editor-block.table-block table tbody {",
        "  margin: 0;",
        "  padding: 0;",
        "  border: 0;",
        "}",
        ".editor-main .editor-block.table-block table table tr {",
        "  border: 0;",
        "  border-top: 1px solid #CCC;",
        "  background-color: white;",
        "  margin: 0;",
        "  padding: 0;",
        "}",
        ".editor-main .editor-block.table-block table tr:nth-child(2n) {",
        "  background-color: #F8F8F8;",
        "}",
        ".editor-main .editor-block.table-block table tr th, ",
        ".editor-main .editor-block.table-block table tr td {",
        "  font-size: 16px;",
        "  border: 1px solid #CCC;",
        "  margin: 0;",
        "  padding: 5px 10px;",
        "}",
        ".editor-main .root-container .editor-block.table-block table tr:first-of-type {",
        "  font-weight: bold;",
        "  color: #eee;",
        "  border: 1px solid #009688;",
        "  background-color: #009688 ;",
        "}",
        ".editor-main .root-container .editor-block.table-block table tr:first-of-type .editor-block {",
        "  font-weight: bold;",
        "  color: #eee;",
        "}",
        ".editor-main .root-container .editor-block.table-block .editor-block {",
        "    margin-top: 0.5em !important;",
        "    margin-bottom: 0.5em !important;",
        "}",
        "/*代码语言选择*/",
        ".editor-main .root-container .editor-block.code-block .editor-code-config .editor-code-language{ ",
        "    color: #2fab58;",
        "}",
        "/*代码关闭行号*/",
        ".editor-main .root-container > .code-block .editor-block.code-line-block:before {",
        "    opacity:0;",
        "}",
        "/*链接*/",
        ".editor-main .root-container a, .editor-main .root-container span.editor-composition.link, .drag-snapshot-container a, .drag-snapshot-container span.editor-composition.link{",
        "    color:#57B175;",
        "}"
    ].join("\n");
    console.log("样式:");
    console.log(css);

    function addGlobalStyle(css) {
        var head, style;
        head = document.getElementsByTagName('head')[0];
        if (!head) { return; }
        style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML = css;
        head.appendChild(style);
    }
    addGlobalStyle(css);

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址