样式代码
/*
* @Author:bealei
* 根据Github改造
*/
:root {
--green: '66, 185, 131';
--blue: '33,123 222';
--red: '66, 185, 131';
/* 绿色 00bb88 */
/* 绿色 42bc7a */
--r: 66;
--g: 188;
--b: 122;
/* 蓝色 1888fa */
/* 蓝色 1685ff */
/* --r: 22;
--g: 133;
--b: 255; */
/* --demo-color: #42B983; */
--demo-color: rgba(var(--r), var(--g), var(--b));
--demo-bg_1: rgba(var(--r), var(--g), var(--b), .1);
--demo-bg_88: rgba(var(--r), var(--g), var(--b), .88);
/* --demo-color: #cb2d01; */
/* --demo-color: #41B883; */
/* 表头背景色 */
--thead-color: var(--demo-bg_88);
--th-color: #d9f1e6;
/* 间隔行背景色 */
--tr-color: #f9fdfb;
--tr2-color: #f2faf6;
--table-color: var(--demo-color);
/* 超链接颜色 */
--a-color: var(--demo-color);
/* 标题颜色 */
--title-color: #000000;
/* 文字颜色 */
--text-color: #123456;
--font-1: "Jetbrains Mono", "DejaVu Sans Mono", "Inconsolata", "Consolas";
--font-2: "Inconsolata", "Menlo", "Monaco", 'Fira Code', 'Roboto Mono', monospace, "Consolas";
/* 内容字体 */
--body-font: var(--font-1);
/* 代码字体 */
--code-font: var(--font-1);
/* 代码块字体 */
--codes-font: var(--font-1);
/* --side-bar-bg-color: #fff;*/
--control-text-color: #777;
--red1: #f56c6c;
--red-2: rgb(255, 18, 52);
--hot: #ff0000;
--h: 255;
--o: 55;
--t: 55;
/* 代码块颜色 */
--code-color: rgba(var(--h), var(--o), var(--t), .88);
/* 代码块背景 */
--code-bgcolor: rgba(var(--h), var(--o), var(--t), .1);
/* 高亮颜色 */
--highlight-color: rgba(var(--h), var(--o), var(--t));
--dagang-color: var(--highlight-color);
}
@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);
/* open-sans-regular - latin-ext_latin */
@media print {
html {
font-size: 13px;
}
table,
pre {
page-break-inside: avoid;
}
pre {
word-wrap: break-word;
}
}
html {
font-size: 16px;
-webkit-font-smoothing: antialiased;
/* 关闭字体连写 */
font-variant-ligatures: none;
}
body {
font-family: var(--body-font);
color: var(--text--color);
-webkit-font-smoothing: antialiased;
line-height: 1.6rem;
letter-spacing: 0;
margin: 0;
overflow-x: hidden;
}
#write {
max-width: 860px;
margin: 0 auto;
padding: 30px;
padding-bottom: 100px;
}
@media only screen and (min-width: 1400px) {
#write {
max-width: 1024px;
}
}
@media only screen and (min-width: 1800px) {
#write {
max-width: 1200px;
}
}
#write>ul:first-child,
#write>ol:first-child {
margin-top: 30px;
}
h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
text-decoration: none;
}
h1 tt,
h1 code {
font-size: inherit;
}
h2 tt,
h2 code {
font-size: inherit;
}
h3 tt,
h3 code {
font-size: inherit;
}
h4 tt,
h4 code {
font-size: inherit;
}
h5 tt,
h5 code {
font-size: inherit;
}
h6 tt,
h6 code {
font-size: inherit;
}
p,
blockquote,
ul,
ol,
dl,
table {
margin: 0.8em 0;
}
li>ol,
li>ul {
margin: 0 0;
}
li p.first {
display: inline-block;
}
ul,
ol {
padding-left: 30px;
}
ul:first-child,
ol:first-child {
margin-top: 0;
}
ul:last-child,
ol:last-child {
margin-bottom: 0;
}
table th:first-child,
table td:first-child {
margin-top: 0;
}
table th:last-child,
table td:last-child {
margin-bottom: 0;
}
.CodeMirror-lines {
padding-left: 4px;
}
.code-tooltip {
box-shadow: 0 1px 1px 0 rgba(0, 28, 36, .3);
border-top: 1px solid #eef2f2;
}
.md-task-list-item>input {
margin-left: -1.3em;
}
@media print {
html {
font-size: 13px;
}
table,
pre {
page-break-inside: avoid;
}
pre {
word-wrap: break-word;
}
}
#write pre.md-meta-block {
padding: 1rem;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border: 0;
border-radius: 3px;
color: #777777;
margin-top: 0 !important;
}
.mathjax-block>.code-tooltip {
bottom: .375rem;
}
.md-mathjax-midline {
background: #fafafa;
}
#write>h3.md-focus:before {
left: -1.5625rem;
top: .375rem;
}
#write>h4.md-focus:before {
left: -1.5625rem;
top: .285714286rem;
}
#write>h5.md-focus:before {
left: -1.5625rem;
top: .285714286rem;
}
#write>h6.md-focus:before {
left: -1.5625rem;
top: .285714286rem;
}
.md-image>.md-meta {
/*border: 1px solid #ddd;*/
border-radius: 3px;
padding: 2px 0px 0px 4px;
font-size: 0.9em;
color: inherit;
}
.md-tag {
color: #a7a7a7;
opacity: 1;
}
.md-toc {
margin-top: 20px;
padding-bottom: 20px;
}
.sidebar-tabs {
border-bottom: none;
}
#typora-quick-open {
border: 1px solid #ddd;
background-color: #f8f8f8;
}
#typora-quick-open-item {
background-color: #FAFAFA;
border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
border-style: solid;
border-width: 1px;
}
/** focus mode */
.on-focus-mode blockquote {
border-left-color: rgba(85, 85, 85, 0.12);
}
header,
.context-menu,
.megamenu-content,
footer {
font-family: "Segoe UI", "Arial", sans-serif;
}
.file-node-content:hover .file-node-icon,
.file-node-content:hover .file-node-open-state {
visibility: visible;
}
.mac-seamless-mode #typora-sidebar {
background-color: #fafafa;
background-color: var(--side-bar-bg-color);
}
.md-lang {
color: #b4654d;
}
/*.html-for-mac {
--item-hover-bg-color: #E6F0FE;
}*/
#md-notification .btn {
border: 0;
}
.dropdown-menu .divider {
border-color: #e5e5e5;
opacity: 0.4;
}
.ty-preferences .window-content {
background-color: #fafafa;
}
.ty-preferences .nav-group-item.active {
color: white;
background: #999;
}
.menu-item-container a.menu-style-btn {
background-color: #f5f8fa;
background-image: linear-gradient(180deg, hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0));
}
/* --------------------------------自定义---------------------------------- */
#write h1,
#write h2,
#write h3,
#write h4,
#write h5,
#write h6 {
position: relative;
color: var(--title-color);
margin: 1.5rem 0;
font-weight: bold;
line-height: 1.4;
cursor: text;
}
#write h1 {
text-align: center;
font-size: 2.2rem;
line-height: 2.2;
color: #fff;
background-color: var(--demo-color);
}
#write h2 {
font-size: 1.8rem;
border-bottom: 3px solid var(--demo-color);
}
/* h2::before {
content: '# ' !important;
color: var(--demo-color);
} */
/* 标题字 */
#write h2 span {
display: inline-block;
background: var(--demo-color);
color: #fff;
padding: 0.1875rem 0.8rem;
border-top-right-radius: 0.1875rem;
border-top-left-radius: 0.1875rem;
margin-right: 0.1875rem;
}
#write h2:after {
display: inline-block;
content: "";
vertical-align: bottom;
border-bottom: 2.785rem solid #efebe9;
/* 阴影宽 */
border-right: 20px solid transparent;
}
#write h3 {
font-size: 1.6rem;
/* color: var(--demo-color); */
/* display: inline-block; */
/* border-bottom: 0.125rem solid var(--demo-color); */
/* text-decoration:underline; */
/* border-left: 0.4375rem solid var(--demo-color); */
/* padding: 0.3125rem 0.625rem; */
}
#write h4 {
font-size: 1.4rem;
/* display: inline-block;
padding: 0 0.5rem;
border: 1px solid var(--demo-color);
border-top: 0.25rem solid var(--demo-color);
margin: 0; */
}
#write h5 {
font-size: 1.2rem;
}
#write h6 {
font-size: 1em;
/* color: #777; */
}
/* ------- 超链接 ------- */
a {
color: var(--a-color);
font-weight: 600;
padding: 0 2px;
text-decoration: none;
}
/* ------- 分割线 ------- */
hr {
height: 2px;
padding: 0;
margin: 16px 0;
background-color: var(--demo-color);
border: 0 none;
overflow: hidden;
box-sizing: content-box;
}
/* ------- 引用 ------- */
blockquote {
border-left: 8px solid var(--demo-color);
padding: 10px 15px;
border-radius: 6px;
background-color: var(--demo-bg_1);
}
/* ------- 高亮 ------- */
#write mark {
background-color: transparent;
color: var(--highlight-color);
font-weight: bold;
}
/* ------- 段落 ------- */
#write p {
line-height: 1.6rem;
word-spacing: .05rem;
margin: 0.2rem;
}
/* ------------代码段------------ */
.md-fences,
code,
tt {
font-size: 0.98em;
}
/* `代码块` */
code {
padding: 0 4px;
margin: 0 4px;
border-radius: 4px;
color: var(--code-color);
background-color: var(--code-bgcolor);
font-family: var(--code-font);
}
/* ```代码段 */
.md-fences {
border: 1px solid #e8e8e8;
border-radius: 10px;
background-color: #f3f6f9;
padding: 0.5rem;
line-height: 1.5rem;
font-family: var(--font-1);
/* 字符左右间距 */
/* letter-spacing: 1px; */
}
/* ------------ 表格------------ */
/* 隔行色 */
table tr:nth-child(2n),
thead {
background-color: #f8f8f8;
}
table {
padding: 0;
word-break: initial;
text-align: center;
border: 2px solid var(--demo-color);
}
/* 表头 */
table th {
/* border: 1px solid var(--demo-color); */
font-weight: bold;
border: 1px solid #dfe2e5;
/* border-bottom: 0; */
margin: 0;
padding: 8px 14px;
font-size: 1.2rem;
color: #fff;
background-color: var(--thead-color);
}
/* 表行 */
table tr {
border: 1px solid var(--demo-color);
margin: 0;
padding: 0;
}
/* 单元格 */
table td {
border: 1px solid var(--demo-color);
margin: 0;
padding: 6px 13px;
}
/* 任务列表小方框 */
.md-task-list-item>input {
margin-left: -1.3em;
margin-top: 0.3rem;
-webkit-appearance: none;
}
.md-task-list-item>input:before {
content: '';
display: inline-block;
width: 0.875rem;
height: 0.875rem;
width: 1rem;
height: 1rem;
vertical-align: middle;
text-align: center;
font-size: 0.8rem;
line-height: 1rem;
color: #fff;
border-radius: 2px;
border: 1px solid var(--demo-color);
margin-top: -0.4rem;
transition: all 0.2s linear;
}
.md-task-list-item>input:checked:before,
.md-task-list-item>input[checked]:before {
content: '\2714';
color: #fff;
border: 1px solid var(--demo-color);
background-color: var(--demo-bg_88);
font-family: 'Courier New', Courier, monospace;
}
/* ------------ 大纲 ------------ */
.outline-title {
/* color: var(--demo-color); */
}
/* 大纲标题 */
.info-panel-tab-title {
color: var(--demo-color);
}
/* 大纲标题下划线 */
.active-tab-files #info-panel-tab-file .info-panel-tab-border,
.active-tab-outline #info-panel-tab-outline .info-panel-tab-border {
background-color: var(--demo-color);
}
/* 大纲侧边栏 */
.outline-item:hover {
font-weight: 700;
color: #fff;
background-color: var(--demo-color);
}
/* 没有下划线 */
.outline-label:hover {
text-decoration: none;
}
/* 停留加粗 */
.outline-item-active {
color: var(--dagang-color);
font-weight: 700;
}
.outline-item-active:hover {
color: #fff;
}
/* ------- 图片 ------- */
#write img {
margin: 1.2rem auto;
display: inline-block;
border-left: 0px;
border-right: 0px;
border-radius: 10px;
/* box-shadow: 6px 6px 18px 10px #ccc; */
filter: drop-shadow(10px 10px 20px rgba(0, 0, 0, .5));
}
/* ------------ 三个点 ------------ */
/**mac 三个点**/
.md-fences::before {
content: '';
/* color: red; */
background: #fa3534;
width: 12px;
height: 12px;
border-radius: 50%;
position: absolute;
left: 10px;
top: 10px;
z-index: 999;
box-shadow: 20px 0px 0px #ff9900, 40px 0px 0px #19be6b;
}
.CodeMirror {
padding-top: 20px !important;
}
.CodeMirror-sizer {
box-shadow: 30px 30px 30px rgba(0, 0, 0, 0.5);
}
/* ------------ 自动行号 ------------ */
/* 计数器 */
h1 {
counter-reset: h3;
}
h2 {
counter-reset: h3;
}
h3 {
counter-reset: h4;
}
h4 {
counter-reset: h5;
}
h5 {
counter-reset: h6;
}
/* 正文的编号 */
#write h3:before,
h3.md-focus.md-heading:before {
/** override the default style for focused headings */
counter-increment: h3;
content: counter(h3) "、";
}
#write h4:before,
h4.md-focus.md-heading:before {
counter-increment: h4;
content: counter(h3) "."counter(h4) " ";
}
#write h5:before,
h5.md-focus.md-heading:before {
counter-increment: h5;
content: counter(h3) "."counter(h4) "."counter(h5) " "
}
/* 鼠标选择输入文字的时候不会放大缩小 */
#write>h3.md-focus:before,
#write>h4.md-focus:before,
#write>h5.md-focus:before,
#write>h6.md-focus:before,
h3.md-focus:before,
h4.md-focus:before,
h5.md-focus:before,
h6.md-focus:before {
color: inherit;
border: inherit;
border-radius: inherit;
position: inherit;
left: initial;
float: none;
top: initial;
font-size: inherit;
padding-left: inherit;
padding-right: inherit;
vertical-align: inherit;
font-weight: inherit;
line-height: inherit;
}
/****************************/
.outline-h1 {
counter-reset: outline-h3;
}
.outline-h2 {
counter-reset: outline-h3;
}
.outline-h3 {
counter-reset: outline-h4;
}
.outline-h4 {
counter-reset: outline-h5;
}
.outline-content .outline-h3 .outline-label:before {
counter-increment: outline-h3;
content: counter(outline-h3) "、";
}
.outline-content .outline-h4 .outline-label:before {
counter-increment: outline-h4;
content: counter(outline-h3) "."counter(outline-h4) " ";
}
.outline-content .outline-h5 .outline-label:before {
counter-increment: outline-h5;
content: counter(outline-h3) "."counter(outline-h4) "."counter(outline-h5) " ";
}
/* 必须补全 */
.outline-content .outline-h6 .outline-label:before {
content: none;
}
/* -------------------自动序号end------------------- */