首页 > 其他分享 >VSCode Markdown preview enhanced 配置中文字体, 自定义css的方法

VSCode Markdown preview enhanced 配置中文字体, 自定义css的方法

时间:2023-02-17 10:47:00浏览次数:40  
标签:body Markdown 自定义 bottom VSCode color html font margin

image

在 Ctrl + Shift + P 命令菜单中选择 Customize CSS

这是我基于Solarized Light的配置文件

注意,只需要在系统中(我的是Win10)安装思源宋体 CN Medium,在系统的字体当中找到它对应的名字即可

/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */

// modify your style here
// eg: background-color: blue;
html body {
  font-family: Georgia, "思源宋体 CN Medium", "Times New Roman", Arial, freesans,
    sans-serif;
  font-size: 17px;
  font-weight: normal;
  line-height: 1.6;
  color: #1e2427;
  /*background-color: #fdf6e3;*/
  background-color: #ffffff;
  overflow: initial;
  box-sizing: border-box;
  word-wrap: break-word;
}

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

html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6 {
  line-height: 1.2;
  margin-top: 1em;
  margin-bottom: 16px;
  color: #1e2427;
}

html body h1 {
  font-size: 2em;
  text-align: center;
  font-weight: 300;
  padding-bottom: 0.3em;
}

html body h2 {
  font-size: 1.75em;
  font-weight: 400;
  /*padding-bottom: .3em;*/
  border-bottom: 1px solid #bfbfbf;
  text-align: center;
}

html body h3 {
  font-size: 1.5em;
  font-weight: 500;
  border-bottom: 1px solid #bfbfbf;
}

html body h4 {
  font-size: 1.25em;
  font-weight: 600;
}

html body h5 {
  font-size: 1.1em;
  font-weight: 600;
}

html body h6 {
  font-size: 1em;
  font-weight: 600;
}

html body h1,
html body h2,
html body h3,
html body h4,
html body h5 {
  font-weight: 600;
}

html body h5 {
  font-size: 1em;
}

html body h6 {
  color: #90a3a9;
}

html body strong {
  color: #1e2427;
}

html body del {
  color: #90a3a9;
}

html body a:not([href]) {
  color: inherit;
  text-decoration: none;
}

html body a {
  color: #08c;
  text-decoration: none;
}

html body a:hover {
  color: #00a3f5;
  text-decoration: none;
}

html body img {
  max-width: 100%;
}

html body > p {
  margin-top: 0;
  margin-bottom: 16px;
  word-wrap: break-word;
}

html body > ul,
html body > ol {
  margin-bottom: 16px;
}

html body ul,
html body ol {
  padding-left: 2em;
}

html body ul.no-list,
html body ol.no-list {
  padding: 0;
  list-style-type: none;
}

html body ul ul,
html body ul ol,
html body ol ol,
html body ol ul {
  margin-top: 0;
  margin-bottom: 0;
}

html body li {
  margin-bottom: 0;
}

html body li.task-list-item {
  list-style: none;
}

html body li > p {
  margin-top: 0;
  margin-bottom: 0;
}

html body .task-list-item-checkbox {
  margin: 0 0.2em 0.25em -1.8em;
  vertical-align: middle;
}

html body .task-list-item-checkbox:hover {
  cursor: pointer;
}

html body blockquote {
  margin: 16px 0;
  font-size: inherit;
  padding: 0 15px;
  color: #90a3a9;
  background-color: #fbedc6;
  border-left: 4px solid #f8de97;
}

html body blockquote > :first-child {
  margin-top: 0;
}

html body blockquote > :last-child {
  margin-bottom: 0;
}

html body hr {
  height: 4px;
  margin: 32px 0;
  background-color: #f8de97;
  border: 0 none;
}

html body table {
  margin: 10px 0 15px 0;
  border-collapse: collapse;
  border-spacing: 0;
  display: block;
  width: 100%;
  overflow: auto;
  word-break: normal;
  word-break: keep-all;
}

html body table th {
  font-weight: bold;
  color: #1e2427;
}

html body table td,
html body table th {
  border: 1px solid #f8de97;
  padding: 6px 13px;
}

html body dl {
  padding: 0;
}

html body dl dt {
  padding: 0;
  margin-top: 16px;
  font-size: 1em;
  font-style: italic;
  font-weight: bold;
}

html body dl dd {
  padding: 0 16px;
  margin-bottom: 16px;
}

html body code {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 0.85em !important;
  color: #1e2427;
  background-color: #fbedc6;
  border-radius: 3px;
  padding: 0.2em 0;
}

html body code::before,
html body code::after {
  letter-spacing: -0.2em;
  content: "\00a0";
}

html body pre > code {
  padding: 0;
  margin: 0;
  font-size: 0.85em !important;
  word-break: normal;
  white-space: pre;
  background: transparent;
  border: 0;
}

html body .highlight {
  margin-bottom: 16px;
}

html body .highlight pre,
html body pre {
  padding: 1em;
  overflow: auto;
  font-size: 0.85em !important;
  line-height: 1.45;
  border: #f8de97;
  border-radius: 3px;
}

html body .highlight pre {
  margin-bottom: 0;
  word-break: normal;
}

html body pre code,
html body pre tt {
  display: inline;
  max-width: initial;
  padding: 0;
  margin: 0;
  overflow: initial;
  line-height: inherit;
  word-wrap: normal;
  background-color: transparent;
  border: 0;
}

html body pre code:before,
html body pre tt:before,
html body pre code:after,
html body pre tt:after {
  content: normal;
}

html body p,
html body blockquote,
html body ul,
html body ol,
html body dl,
html body pre {
  margin-top: 0;
  margin-bottom: 16px;
}

html body kbd {
  color: #1e2427;
  border: 1px solid #f8de97;
  border-bottom: 2px solid #f6d47a;
  padding: 2px 4px;
  background-color: #fbedc6;
  border-radius: 3px;
}

@media print {
  html body {
    /*background-color: #fdf6e3;*/
    background-color: #ffffff;
  }

  html body h1,
  html body h2,
  html body h3,
  html body h4,
  html body h5,
  html body h6 {
    color: #1e2427;
    page-break-after: avoid;
  }

  html body blockquote {
    color: #90a3a9;
  }

  html body pre {
    page-break-inside: avoid;
  }

  html body table {
    display: table;
  }

  html body img {
    display: block;
    max-width: 100%;
    max-height: 100%;
  }

  html body pre,
  html body code {
    word-wrap: break-word;
    white-space: pre;
  }
}

标签:body,Markdown,自定义,bottom,VSCode,color,html,font,margin
From: https://www.cnblogs.com/zxyfrank/p/17129286.html

相关文章

  • markdown学习
    markdown使用学习#+标题名字选择标题最多6级一个#表示加一级一级最大字体对字体加粗等操作hello**hello**粗体hello*hello*斜体hello***hello*......
  • vue3+vant中自定义隐藏DropdownMenu下拉菜单
    一、概述需求:当点击确定按钮时隐藏下拉菜单。主要使用的方法:ref标识当前组件van-dropdown-item,当点击确定按钮时通过getCurrentInstance来获取组件身上的属性方法。......
  • Day01 Markdown学习
    Markdown学习标题:#+空格+标题:一级标题##+空格+标题:二级标题###+空格+标题:三级标题……最多到六级标题 字体:Hello,World!两个*加粗Hello,World!一个*斜体......
  • Pandoc 将 markdown 文件转化为 pdf 命令
    之前查阅其它博客发现命令会报错,经尝试,现在使用Pandoc将markdown文件转化为pdf文件的命令如下:pandoc-s--toc--pdf-engine=xelatex-VCJKmainfont="SimSun"-V......
  • MarkDown基础
    MarkDown基础教学各种标题一级/二级/三级/.../n级标题都是采用###的形式,几个#号就代表第几级标题字体粗体采用双*号夹住内容,例如你好斜体采用单星号夹住内......
  • springboot自定义校验工具类
    参考:https://betheme.net/news/txtlist_i120686v.html?action=onClickhttps://www.ngui.cc/el/2571188.html?action=onClick一、原生注解在springboot中,我们可以使用ja......
  • PHP 之自定义模板解析
    一、解析列表1、效果图 2、示例代码<?phpinclude_once'parse.func.php';$data=array(array('scode'=>2,'link'=>'https://www.b......
  • Markdown学习
    Markdown学习二级标题三级标题四级标题Hello,Word!Hello,Word!Hello,Word!Hello,Word! 引用 分割线 超链接跳转 列表ABC ABC ......
  • 自定义批量上传一些逻辑
    <template><!--上传弹窗--><el-dialogtitle="上传文档"width="648px":close-on-press-escape="false":close-on-click-modal="false":vi......
  • element-ui的tree结构自定义节点点击是否可触发展开缩放
    近期公司项目,用element-ui的tree结构渲染一套数据,层级以两级或三级居多其中一级节点无实际意义,因此希望一级节点点击后正常展开缩放二级节点有实际意义,点击后,若下方有三......