Bootstrap

vscode 自用样式分享(基于Pie)

如何在 vscode 使用自用的markdown样式:
https://blog.csdn.net/RP123123123/article/details/118110733

Markdown Preview Enhanced 插件将markdown打印成带样式的PDF:
https://blog.csdn.net/RP123123123/article/details/118113026


预览:

在这里插入图片描述

CSS主样式

@include-when-export url('https://fonts.googleapis.com/css2?family=Roboto+Mono&family=Source+Sans+Pro&display=swap');

/* cyrillic-ext */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Mono'), local('RobotoMono-Regular'),
    url('pie/L0x5DF4xlVMF-BfR8bXMIjhGq3-cXbKDO1w.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Mono'), local('RobotoMono-Regular'),
    url('pie/L0x5DF4xlVMF-BfR8bXMIjhPq3-cXbKDO1w.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* greek-ext */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Mono'), local('RobotoMono-Regular'),
    url('pie/L0x5DF4xlVMF-BfR8bXMIjhHq3-cXbKDO1w.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}

/* greek */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Mono'), local('RobotoMono-Regular'),
    url('pie/L0x5DF4xlVMF-BfR8bXMIjhIq3-cXbKDO1w.woff2') format('woff2');
  unicode-range: U+0370-03FF;
}

/* vietnamese */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Mono'), local('RobotoMono-Regular'),
    url('pie/L0x5DF4xlVMF-BfR8bXMIjhEq3-cXbKDO1w.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Mono'), local('RobotoMono-Regular'),
    url('pie/L0x5DF4xlVMF-BfR8bXMIjhFq3-cXbKDO1w.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Mono'), local('RobotoMono-Regular'),
    url('pie/L0x5DF4xlVMF-BfR8bXMIjhLq3-cXbKD.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmhduz8A.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwkxduz8A.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* greek-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmxduz8A.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}

/* greek */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlBduz8A.woff2') format('woff2');
  unicode-range: U+0370-03FF;
}

/* vietnamese */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmBduz8A.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmRduz8A.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdu.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
    url('pie/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lqDY.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
    url('pie/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lqDY.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* greek-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
    url('pie/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lqDY.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}

/* greek */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
    url('pie/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lqDY.woff2') format('woff2');
  unicode-range: U+0370-03FF;
}

/* vietnamese */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
    url('pie/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lqDY.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
    url('pie/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lqDY.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
    url('pie/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 600;
  src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmhduz8A.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 600;
  src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwkxduz8A.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* greek-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 600;
  src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmxduz8A.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}

/* greek */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 600;
  src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlBduz8A.woff2') format('woff2');
  unicode-range: U+0370-03FF;
}

/* vietnamese */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 600;
  src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmBduz8A.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 600;
  src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmRduz8A.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 600;
  src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'),
    url('pie/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdu.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --side-bar-bg-color: #FFF2E2; /*更改后的大纲背景颜色,浅褐色*/
  /* --side-bar-bg-color: #ffffff;  大纲的背景颜色(默认是白色)*/
  --control-text-color: #777777;
  --select-text-bg-color: #faa295;
  --active-file-text-color: #262626;
  --active-file-border-color: #f22f27;

  /* --active-file-bg-color: #fff3f0; */
  --primary-color: #f22f27;

  /* 中性色 */
  --mid-1: #ffffff;
  --mid-2: #fafafa;
  --mid-3: #f5f5f5;
  --mid-4: #f0f0f0;
  --mid-5: #d9d9d9;
  --mid-6: #bfbfbf;
  --mid-7: #8c8c8c;
  --mid-8: #595959;
  --mid-9: #434343;
  --mid-10: #262626;
  --mid-11: #1f1f1f;
  --mid-12: #141414;
  --mid-13: #000000;

  /* 主题色 */
  --main-1: #fff3f0;
  --main-2: #ffd4cc;
  --main-3: #ffafa3;
  --main-4: #ff887a;
  --main-5: #ff5d52;
  --main-6: #f22f27;
  --main-7: #cc1616;
  --main-8: #a60a0f;
  --main-9: #80010a;
  --main-10: #590009;
}

html {
  font-size: 17px;
  background-color: var(--side-bar-bg-color); /* 将背景颜色设置为浅褐色 */
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: 'Source Sans Pro', '等距更纱黑体 SC', 'Helvetica Neue', Arial, sans-serif !important;
  line-height: 1.8rem;
  color: var(--mid-10);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-print-color-adjust: exact; /*使页面的背景颜色在pdf中显示*/
}

#write {
  max-width: 860px;
  padding: 20px 30px 160px;
  margin: 0 auto;
}

#write p {
  word-spacing: 0.05rem;
}

#write ol li {
  margin-left: -4px;
}

#write ol li p {
  margin-left: 4px;
}

#write ul {
  line-height: 2rem;
}

#write > ul:first-child,
#write > ol:first-child {
  margin-top: 30px;
}

body > *:first-child {
  margin-top: 0 !important;
}

body > *:last-child {
  margin-bottom: 0 !important;
}

a {
  padding: 0 2px;
  font-weight: 500;
  color: var(--main-6);
  text-decoration: none;
}

/* 链接 */
#write a {
  color: var(--main-6);
  text-decoration: none;
  border-bottom: 1px solid var(--main-6);
}

/* 链接内容为空时直接啥也不显示,比如锚点的地方 */
#write a:empty {
  font-size: 0;
  border: none;
}

/* 目录 */
#write a.md-toc-inner {
  line-height: 1.6;
  white-space: pre-line;
  border-bottom: none;
}

#write a:hover {
  color: var(--main-7);
  border-bottom: 2px solid var(--main-6);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-weight: bold;
  line-height: 1.4;
  cursor: text;
}

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,
h2 tt,
h2 code,
h3 tt,
h3 code,
h4 tt,
h4 code,
h5 tt,
h5 code,
h6 tt,
h6 code {
  font-size: inherit !important;
}

h2 a,
h3 a {
  color: var(--mid-9);
}

h1 {
  padding-bottom: 0.3em;
  margin: 2.4em auto 1.2em;
  font-size: 2em;
  line-height: 1.2;
  text-align: center;
  border-bottom: 3px solid red;
}

h2 {
  padding-left: 6px;
  margin: 2em auto 1.4em;
  font-size: 1.6em;
  line-height: 1.4;
  border-left: 6px solid var(--main-6);
}

h3 {
  margin: 1.6em auto 1.2em;
  font-size: 1.35em;
  line-height: 1.43;
}

/* --- 三级标题左边的小圆点 --- */
h3::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  margin-bottom: 0.18em;
  line-height: 1.43;
  vertical-align: middle;
  content: '';
  background-color: var(--main-5);
  border-radius: 50%;
}

/* 三级四级标题点击后左边的提示图标 */
#write > h3.md-focus::before,
#write > h4.md-focus::before {
  width: auto;
  height: auto;
  color: var(--mid-1);
  background-color: var(--main-5);
}

h4 {
  margin-top: 1.4em;
  font-size: 1.2em;
}

/* --- 四级标题左边的小短线 --- */
h4::before {
  display: inline-block;
  width: 6px;
  height: 2px;
  margin-right: 8px;
  margin-bottom: 0.18em;
  vertical-align: middle;
  content: '';
  background-color: var(--main-4);
}

h5 {
  font-size: 1em;
}

h6 {
  font-size: 1em;
  color: var(--mid-7);
}

p,
blockquote,
ul,
ol,
dl,
table {
  margin: 0.8em 0;
}

li > ol,
li > ul {
  margin: 0;
}

hr {
  box-sizing: content-box;
  width: 100%;
  height: 1px;
  padding: 0;
  margin: 46px auto 64px;
  overflow: hidden;
  background-color: var(--main-4);
  border: 0;
}

body > h2:first-child {
  padding-top: 0;
  margin-top: 0;
}

body > h1:first-child {
  padding-top: 0;
  margin-top: 0;
}

body > h1:first-child + h2 {
  padding-top: 0;
  margin-top: 0;
}

body > h3:first-child,
body > h4:first-child,
body > h5:first-child,
body > h6:first-child {
  padding-top: 0;
  margin-top: 0;
}

a:first-child h1,
a:first-child h2,
a:first-child h3,
a:first-child h4,
a:first-child h5,
a:first-child h6 {
  padding-top: 0;
  margin-top: 0;
}

h1 p,
h2 p,
h3 p,
h4 p,
h5 p,
h6 p {
  margin-top: 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;
}

/* --- 引用块 --- */
blockquote {
  position: relative;
  padding: 24px 16px 12px;
  margin: 24px 0 36px;
  font-size: 1em;
  font-style: normal;
  line-height: 1.6;
  color: var(--mid-7);
  text-indent: 0;
  border: none;
  border-left: 2px solid var(--main-6);
}

blockquote blockquote {
  padding-right: 0;
}

blockquote a {
  color: var(--main-4);
}

blockquote::before {
  position: absolute;
  top: 0;
  left: 12px;
  font-family: Arial, serif;
  font-size: 2em;
  font-weight: 700;
  line-height: 1em;
  color: var(--main-6);
  content: '“';
}

table {
  padding: 0;
  margin: 36px auto;
  word-break: initial;
  border-collapse: collapse;/** 将单元格之间的间距设为0 **/
}

table tr {
  padding: 0;
  margin: 0;
  border-top: 1px solid #dfe2e5;
}

table tr:nth-child(2n),
thead {
  background-color: var(--mid-3);
}

table tr th {
  padding: 6px 13px;
  margin: 0;
  font-weight: bold;
  text-align: left;
  border: 1.5px solid var(--mid-7); /*把表格边沿线的颜色改的深了一点*/
  border-bottom: 0;
}

table tr td {
  padding: 6px 13px;
  margin: 0;
  text-align: left;
  border: 1.5px solid var(--mid-7); /*把表格边沿线的颜色改的深了一点*/
}

table tr th:first-child,
table tr td:first-child {
  margin-top: 0;
}

table tr th:last-child,
table tr td:last-child {
  margin-bottom: 0;
}

#write table thead th {
  text-align: center;
  background-color: #f2f2f2;
}

#write strong {
  padding: 0 1px;
}

#write em {
  padding: 0 5px 0 2px;
}

#write .CodeMirror-gutters {
  border-right: none;
}

/* 代码块 */
#write .md-fences {
  margin: 1.8rem 0 2rem !important;
  font-family: Roboto Mono, Source Sans Pro, 'Microsoft YaHei', '微软雅黑' !important;
  font-size: 0.9rem;
  line-height: 1.55rem;
  color: var(--mid-10);
  word-wrap: normal;
  -webkit-font-smoothing: initial;
}

#write .CodeMirror-wrap .CodeMirror-code pre {
  padding-left: 12px;
  line-height: 1.55rem;
}

#write .CodeMirror-cursors .CodeMirror-cursor {
  border-left: 2px solid var(--mid-4);
}

#write code,
tt {
  padding: 2px 4px 1px;
  margin: 0 2px;
  font-family: Roboto Mono, Source Sans Pro, 'Microsoft YaHei', '微软雅黑' !important;
  font-size: 0.92rem;
  color: var(--main-5);
  background-color: var(--main-1);
  border-radius: 3px;
}

#write .md-footnote {
  color: var(--main-5);
  background-color: var(--main-1);
}

/* 流程图块 */
#write .md-diagram-panel {
  position: relative;
  margin: 24px auto;
}

#write .md-focus .md-diagram-panel {
  border: 1px solid var(--main-4);
  border-radius: 4px;
}

/* heighlight. */
#write mark {
  padding: 2px 4px;
  margin: 0 2px;
  font-weight: 500;
  color: #222222;
  background-color: var(--main-4);
  border-radius: 2px;
  border-radius: 4px;
}

#write del {
  padding: 1px 2px;
}

/* 任务列表小方框 */
.md-task-list-item > input {
  margin-top: 0.3rem;
  margin-left: -1.3em;
  -webkit-appearance: none;
}

.md-task-list-item > input::before {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  margin-top: -0.4rem;
  font-size: 0.8rem;
  color: var(--mid-1);
  text-align: center;
  vertical-align: middle;
  content: '';
  border: 1px solid var(--main-4);
  border-radius: 2px;
  transition: all 0.2s linear;
}

.md-task-list-item > input:checked::before,
.md-task-list-item > input[checked]::before {
  font-size: 0.625rem;
  color: var(--mid-1);
  content: '\2714';
  background-color: var(--main-6);
  border: 1px solid var(--main-6);
}

@media print {
  html {
    font-size: 13px;
  }

  table,
  pre {
    page-break-inside: avoid;
  }

  pre {
    word-wrap: break-word;
  }
}

/* .md-fences {
  background-color: #f8f8f8;
} */

#write pre.md-meta-block {
  margin-top: 0 !important;

  /* padding: 1rem; */
  font-size: 85%;
  line-height: 1.45;
  color: #777777;
  background-color: #f7f7f7;
  border: 0;
  border-radius: 3px;
}

.mathjax-block > .code-tooltip {
  bottom: 0.375rem;
}

#write > h3.md-focus::before {
  top: 0.375rem;
  left: -1.5625rem;
}

#write > h4.md-focus::before {
  top: 0.285714286rem;
  left: -1.5625rem;
}

#write > h5.md-focus::before {
  top: 0.285714286rem;
  left: -1.5625rem;
}

#write > h6.md-focus::before {
  top: 0.285714286rem;
  left: -1.5625rem;
}

/* --- 图片 --- */
.md-image {
  margin: 24px auto;
  border-radius: 4px;
}

.md-image img {
  border: none;
  border-radius: 4px;
}

/* 当 “![shadow-随便写]()”写时,会有阴影 */
.md-image img[alt|='shadow'] {
  box-shadow: 0 4px 24px -6px #dddddd;
}

.md-image > .md-meta {
  padding: 2px 0 0 4px;
  font-family: Consolas, 'Liberation Mono', Courier, monospace;
  font-size: 0.9em;
  color: inherit;
  border-radius: 3px;
}

/* emoji */
.md-emoji-span::before {
  font-weight: 400;
  vertical-align: inherit;
  content: attr(data-emoji);
}

.md-tag {
  color: inherit;
}

.md-toc {
  padding-bottom: 20px;
  margin-top: 20px;
}

.sidebar-tabs {
  border-bottom: none;
}

#typora-quick-open {
  background-color: #f8f8f8;
  border: 1px solid #dddddd;
}

#typora-quick-open-item {
  background-color: #fafafa;
  border-color: #fefefe #e5e5e5 #e5e5e5 #eeeeee;
  border-style: solid;
  border-width: 1px;
}

#md-notification::before {
  top: 10px;
}

/** 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: var(--side-bar-bg-color);
}

.md-lang {
  color: #b4654d;
}

.html-for-mac .context-menu {
  --item-hover-bg-color: #e6f0fe;
}

/* 侧边栏 */
.file-list-item.active {
  color: var(--active-file-text-color);
  background: var(--active-file-bg-color);
  border-left: 4px solid var(--main-6);
}

.file-tree-node.active > .file-node-background {
  background-color: var(--active-file-bg-color);
  border-color: var(--active-file-border-color);
  border-left: 4px solid var(--main-6);
}

/* ----------------- 代码块主题 ----------------- */
.cm-s-inner.CodeMirror {
  padding: 0.8rem 0 1rem;
  color: #f0f0f0;
  background-color: #292d3e;
  border-radius: 4px;
}

.cm-s-inner .CodeMirror-gutters {
  color: #676e95;
  background: #292d3e;
  border: none;
}

.cm-s-inner .CodeMirror-guttermarker,
.cm-s-inner .CodeMirror-guttermarker-subtle,
.cm-s-inner .CodeMirror-linenumber {
  color: #676e95;
}

.cm-s-inner .CodeMirror-cursor {
  border-left: 1px solid #ffcc00;
}

.cm-s-inner div.CodeMirror-selected {
  background: rgba(113, 124, 180, 0.2);
}

.cm-s-inner.CodeMirror-focused div.CodeMirror-selected {
  background: rgba(113, 124, 180, 0.2);
}

.cm-s-inner .CodeMirror-line::selection,
.cm-s-inner .CodeMirror-line > span::selection,
.cm-s-inner .CodeMirror-line > span > span::selection {
  background: rgba(128, 203, 196, 0.2);
}

.cm-s-inner .CodeMirror-line::-moz-selection,
.cm-s-inner .CodeMirror-line > span::-moz-selection,
.cm-s-inner .CodeMirror-line > span > span::-moz-selection {
  background: rgba(128, 203, 196, 0.2);
}

/* .cm-s-inner .CodeMirror-activeline-background {
    background: rgba(255, 255, 255, 0.5);
  } */

.cm-s-inner .cm-keyword {
  color: #c792ea;
}

.cm-s-inner .cm-operator {
  color: #89ddff;
}

.cm-s-inner .cm-variable-2 {
  color: #eeffff;
}

.cm-s-inner .cm-variable-3,
.cm-s-inner .cm-type {
  color: #f07178;
}

.cm-s-inner .cm-builtin {
  color: #ffcb6b;
}

.cm-s-inner .cm-atom {
  color: #f78c6c;
}

.cm-s-inner .cm-number {
  color: #ff5370;
}

.cm-s-inner .cm-def {
  color: #82aaff;
}

.cm-s-inner .cm-string {
  color: #c3e88d;
}

.cm-s-inner .cm-string-2 {
  color: #f07178;
}

.cm-s-inner .cm-comment {
  color: #676e95;
}

.cm-s-inner .cm-variable {
  color: #f07178;
}

.cm-s-inner .cm-tag {
  color: #ff5370;
}

.cm-s-inner .cm-meta {
  color: #ffcb6b;
}

.cm-s-inner .cm-attribute {
  color: #c792ea;
}

.cm-s-inner .cm-property {
  color: #c792ea;
}

.cm-s-inner .cm-qualifier {
  color: #decb6b;
}

.cm-s-inner .cm-variable-3,
.cm-s-inner .cm-type {
  color: #decb6b;
}

.cm-s-inner .cm-error {
  color: rgba(255, 255, 255, 1);
  background-color: #ff5370;
}

.cm-s-inner .CodeMirror-matchingbracket {
  color: white !important;
  text-decoration: underline;
}

代码块样式

@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");


*{
    -webkit-font-smoothing:antialiased;
    -webkit-overflow-scrolling:touch;
    -webkit-tap-highlight-color:rgba(0, 0, 0, 0);
    -webkit-text-size-adjust:none; 
    -webkit-touch-callout:none;
    box-sizing:border-box
}
.markdown-preview code
{
    border-radius:2px; 
    color:#6a2be0;
    font-size: 16px;
    font-size: 16px;
    margin:0 2px;
    padding:3px 5px;
    white-space:pre-wrap
}
.markdown-preview code,.markdown-preview pre
{
    background-color:#f8f8f8;
    font-family: Roboto Mono, Source Sans Pro, 'Microsoft YaHei', '微软雅黑';
}
.markdown-preview pre
{
    -moz-osx-font-smoothing:initial;
    -webkit-font-smoothing:initial;
    line-height:24px;
    line-height:1.5rem;
    margin:1.2em 0;
    overflow:auto;
    padding:0 22.4px;
    padding:0 1.4rem;
    position:relative;
    word-wrap:normal
}
.token.cdata,.token.comment,.token.doctype,.token.prolog{
    color:#898ac0 ;
}
.token.namespace
{
    color:#1625fdef !important;
}
.token.boolean,.token.number
{
    color:#d19a66!important;
}
.token.punctuation
{
    color:#e44608 !important ;
}
.token.property
{
    color:#dee033 !important;
}
.token.tag
{
    color:#1366b4 !important;
}
.token.string
{
    color:#98c376 !important;
    color:var(--theme-color, #216949)
}
.token.selector
{
    color:#6679cc!important;
}
.token.attr-name
{
    color:#2973b7!important;
}.language-css .token.string,.style .token.string,.token.entity,.token.url{
    color:#22a2c9!important;
}
.token.attr-value,.token.control,.token.directive,.token.unit{
    color:#42b983!important;   
    color:var(--theme-color, #42b983)
}
.token.keyword{
    color:#c678dd!important;
}.token.atrule,.token.regex,.token.statement{
    color:#22a2c9!important;
}
.token.placeholder,.token.variable{
    color:#3d8fd1!important;
}.token.deleted{
    text-decoration:line-through;
}
.token.inserted{
    border-bottom:1px dotted #202746!important;
    
    text-decoration:none;
}
.token.italic{
    font-style:italic;
}.token.bold,.token.important{
    font-weight:700;
}
.token.important{
    color:#a9cec0!important;
    
}.token.entity{
    cursor:help;
}
.markdown-preview pre>code
{
    -moz-osx-font-smoothing:initial;
    -webkit-font-smoothing:initial;
    background-color:#0c0d0e;
    border-radius:2px;
    color:#d19a66;
    display:block;
    font-family: Roboto Mono, Source Sans Pro, 'Microsoft YaHei', '微软雅黑';
    font-size:15px !important;
    font-size:2rem;
    line-height:2em;
    max-width:inherit;
    overflow:inherit;
    padding:.8em 1.4em;
    white-space:pre;
}
.markdown-preview pre[class*="language"]
{
    -moz-osx-font-smoothing:initial;
    -webkit-font-smoothing:initial;
    background-color:#0c0d0e;
    border-radius: 10px 10px ;
    color:#d19a66;
    display:block;
    font-family: Roboto Mono, Source Sans Pro, 'Microsoft YaHei', '微软雅黑';
    font-size:15px !important;
    font-size:2rem;
    line-height:2em;
    max-width:inherit;
    overflow:inherit;
    padding: 30px 1.4em 0px 30px !important;
    white-space:pre;
    
}
.markdown-preview pre>code
{
    padding-left:0;    
    padding-right:0
}
.markdown-preview code:after,
.markdown-preview code:before
{
    letter-spacing:.8px;    
    letter-spacing:.05rem;
}
code .token
{
    -moz-osx-font-smoothing:initial;    
    -webkit-font-smoothing:initial;
    min-height:24px;
    min-height:1.5rem
}
pre:after
{
    color:#ccc;    
    content:attr(data-lang);
    font-size:16px;
    font-size:16px;
    font-weight:600;
    height:15px;
    line-height:15px;
    padding:5px 10px 0;
    position:absolute;
    right:0;
    text-align:right;
    top:0
}
pre[data-line]
{
    position:relative;    
    padding:1em 0 1em 3em !important
}
pre[data-line] .line-highlight-wrapper
{
    position:absolute;
    top:0;
    left:0;
    background-color:transparent;
    display:block;
    width:100%
}
pre[data-line] .line-highlight
{
    position:absolute;
    left:0;
    right:0;
    padding:inherit 0;
    margin-top:1em;
    background:rgba(153,122,102,0.08);
    background:linear-gradient(to right, rgba(153,122,102,0.1) 70%, rgba(153,122,102,0));
    pointer-events:none;
    line-height:inherit;
    white-space:pre
}
pre[data-line] .line-highlight:before,pre[data-line] .line-highlight[data-end]:after{
    content:attr(data-start);   
    position:absolute;
    top:.4em;
    left:.6em;
    min-width:1em;
    padding:0 .5em;
    background-color:rgba(153,122,102,0.4);
    color:#f5f2f0;
    font:bold 65%/1.5 sans-serif;
    text-align:center;
    vertical-align:.3em;
    border-radius:999px;
    text-shadow:none;
    box-shadow:0 1px white;
    
}
pre[data-line] .line-highlight[data-end]:after
{
    content:attr(data-end);
    top:auto;
    bottom:.4em
}

pre:before {
	content:" ";
	position:absolute;
	-webkit-border-radius:50%;
	border-radius:50%;
	background:#fc625d ;
	width:12px;
	height:12px;
	left:10px;
    top:10px;
	-webkit-box-shadow:20px 0 #fdbc40,40px 0 #35cd4b;
	box-shadow:20px 0 #fdbc40,40px 0 #35cd4b;
	z-index:2
}
pre {
	background:#21252b ;
	border-radius:5px;
	font:15px/22px"Microsoft YaHei",Arial,Sans-Serif;
	line-height:1.4;
	margin-bottom:1.6em;
	max-width:100%;
    overflow: auto ;
	text-shadow:none;
	color:#000;
	box-shadow:0 10px 30px 0 rgba(0,0,0,.4)
}
pre code::-webkit-scrollbar {
    height:10x !important;
    width:10x !important;
    background-color:#1d1f21 !important
}
pre code::-webkit-scrollbar-track {
    -webkit-box-shadow:inset 0 0 6px rgba(0, 0, 0, .3) !important;
    border-radius:10px !important;
    background-color:#21252b !important;
    box-shadow: 0 0 6px rgba(0, 0, 0, .3);
}
pre code::-webkit-scrollbar-thumb {
    border-radius:10px !important;
    -webkit-box-shadow:inset 0 0 6px rgba(0, 0, 0, .5) !important;
    background-color:#21252b !important;
    box-shadow: 0 0 6px rgba(0, 0, 0, .3);
}





css是基于pie 样式做出了相应修改

代码块css是用的:https://blog.csdn.net/qq_43324834/article/details/107551200

;