首页 > 其他分享 >Typora 改变代码块颜色

Typora 改变代码块颜色

时间:2024-10-09 18:50:27浏览次数:8  
标签:md counter 颜色 outline color 代码 Typora CodeMirror before

改变代码块的颜色

        改成这样的样式

        首先 打开文件 -> 偏好设置 -> 外观 -> 主题 -> 打开主题文件夹

        并在该文件下创建创建base.user.css文件,引入下面的代码内容,即可.

 
.CodeMirror-line .cm-number{color:#7f6bff} /*数字,蓝色*/
.CodeMirror-line .cm-property {
    color: #f08d49;
}
.CodeMirror-line .cm-variable-3{color:#ffed6b} /*返回值、变量类型,int、void等,淡黄色*/
.CodeMirror-line .cm-qualifier{color:#888}
.CodeMirror-line .cm-variable-2 {
    color: #888;
} 
.CodeMirror-line .cm-meta{ color:#BBFFFF}  /* 头文件、宏定义一整行 青色*/
.CodeMirror-line .cm-atom { color:#f9ff00} /* true、false 黄色*/
.CodeMirror-line .cm-keyword{    color: #ff1800;} /* if、return等关键字红色*/

.CodeMirror-line .cm-def{ color:#00ff00  } /* 函数定义,绿色 */


.CodeMirror-line .cm-variable { color: #90EE90; } /* 入参定义,亮绿色 */

.CodeMirror-line .cm-builtin {
    color: #82AAFF;
}/* 蓝色 */
.CodeMirror-line .cm-comment {
    color: #888;
} /* 灰色 */
.CodeMirror-line .cm-string{ color: #82AAFF  } /* 字符串, 蓝色*/
.CodeMirror-line .cm-string-2 { color: #888  }
.CodeMirror-line .cm-operator {color: #ff1800}/* +=等操作符,红色*/
.CodeMirror div.CodeMirror-cursor {
    border-left: 1px solid #fff;
    z-index: 3;
}
.CodeMirror-selected,
.CodeMirror-selectedtext {
    background: #666 !important;
}
 
 
.CodeMirror-line .cm-tag{
    color: #F07178;
}
.CodeMirror-line .cm-bracket{
    color: #FFF;
}
.CodeMirror-line .cm-attribute{
    color: #FFCB6B;
}

.sidebar-content {
    counter-reset: h1
}
 
.outline-h1 {
    counter-reset: h2
}
 
.outline-h2 {
    counter-reset: h3
}
 
.outline-h3 {
    counter-reset: h4
}
 
.outline-h4 {
    counter-reset: h5
}
 
.outline-h5 {
    counter-reset: h6
}
 
.outline-h1>.outline-item>.outline-label:before {
    counter-increment: h1;
    content: counter(h1) " "
}
 
.outline-h2>.outline-item>.outline-label:before {
    counter-increment: h2;
    content: counter(h1) "."counter(h2) " "
}
 
.outline-h3>.outline-item>.outline-label:before {
    counter-increment: h3;
    content: counter(h1) "."counter(h2) "."counter(h3) " "
}
 
.outline-h4>.outline-item>.outline-label:before {
    counter-increment: h4;
    content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) " "
}
 
.outline-h5>.outline-item>.outline-label:before {
    counter-increment: h5;
    content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) " "
}
 
.outline-h6>.outline-item>.outline-label:before {
    counter-increment: h6;
    content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) "."counter(h6) " "
}
 
#write {
    counter-reset: h1
}
 
h1 {
    counter-reset: h2
}
 
h2 {
    counter-reset: h3
}
 
h3 {
    counter-reset: h4
}
 
h4 {
    counter-reset: h5
}
 
h5 {
    counter-reset: h6
}
 
#write h1:before {
    counter-increment: h1;
    content: counter(h1) " "
}
 
#write h2:before {
    counter-increment: h2;
    content: counter(h1) "."counter(h2) " "
}
 
#write h3:before,
h3.md-focus.md-heading:before
 
    {
    counter-increment: h3;
    content: counter(h1) "."counter(h2) "."counter(h3) " "
}
 
#write h4:before,
h4.md-focus.md-heading:before {
    counter-increment: h4;
    content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) " "
}
 
#write h5:before,
h5.md-focus.md-heading:before {
    counter-increment: h5;
    content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) " "
}
 
#write h6:before,
h6.md-focus.md-heading:before {
    counter-increment: h6;
    content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) "."counter(h6) " "
}
 
#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;
}
 
.CodeMirror-lines {
    padding-left: 4px;
}
 
.code-tooltip {
    box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
    border-top: 1px solid #eef2f2;
}
 
.md-fences,
code,
tt {
    background-color: #f8f8f8;
    border-radius: 3px;
    padding: 0;
    padding-left: 4px !important;
    padding-right: 4px !important;
    font-size: 0.9em;
}
 
code {
    background-color: #f3f4f4;
    padding: 0 2px 0 2px;
}
 
.md-fences {
    margin-bottom: 15px;
    margin-top: 15px;
    padding-top: 8px;
    padding-bottom: 6px;
}
 
 
.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;
    }
}
 
.md-fences {
    background-color: #f8f8f8;
}
#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;
}
 
 
 
 
 
#write .md-fences:not([mermaid-type])  {
    padding-top: 7px;
    border-radius: 10px;
    background-color: #282c34;
    color: #eeeeee;
}
 
.code-tooltip .ty-input,
.code-tooltip input {
    color: #eee;
}
 
 
 
.CodeMirror-wrap .CodeMirror-scroll {
    padding-top: 20px;
}
 
#write .md-fences:before {
    content: "";
    z-index: 4;
    display: block;
    position: absolute;
    top: 7px;
    left: 13px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    float: left;
    background-color: #fa3534;
}
 
#write .CodeMirror-scroll:before {
    content: "";
    display: block;
    position: absolute;
    top: 0px;
    left: 29px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    float: left;
    z-index: 999;
    background-color: #ff9900;
}
#write .md-fences::after {
    content: "";
    z-index: 4;
    display: block;
    position: absolute;
    top: 7px;
    left: 53px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    float: left;
    background-color: #19be6b;
}

标签:md,counter,颜色,outline,color,代码,Typora,CodeMirror,before
From: https://blog.csdn.net/2302_80111658/article/details/140816108

相关文章

  • 无人机集群路径规划:5种优化算法(APO、GOOSE、CO、PSO、PIO)求解无人机集群路径规划,提供M
     一、单个无人机路径规划模型介绍无人机三维路径规划是指在三维空间中为无人机规划一条合理的飞行路径,使其能够安全、高效地完成任务。路径规划是无人机自主飞行的关键技术之一,它可以通过算法和模型来确定无人机的航迹,以避开障碍物、优化飞行时间和节省能量消耗。二、无人......
  • 霍普菲尔德(Hopfield)神经网络求解旅行商问题TSP,提供完整MATLAB代码,复制粘贴即可运行
    Hopfield神经网络是以美国物理学家约翰·霍普菲尔德(JohnHopfield)的名字命名的。他在1982年提出了这种类型的神经网络模型,因此通常被称为Hopfield网络。旅行商问题(TravelingSalesmanProblem,TSP)是一个经典的组合优化问题,即在给定一组城市及城市之间的距离,找到一条遍历所有......
  • 快速的配置Prettier,让代码更整洁
    快速的配置Prettier,让代码更整洁一个人一个代码风格,先抛开语法的使用不谈,加不加空格、加不加分号也是萝卜白菜各有所爱,那怎么统一我们的代码格式呢prettier就是为我们解决这个问题的1.如何制定我们的代码风格我们可以在这里进行代码格式的自定义配置配置完成之后我们可以......
  • RT-DETR改进|爆改模型|涨点|使用VMamba作为骨干网络(附代码+修改教程)
    一、文本介绍本文修改的模型是RT-DETR,在原本的RT-DETR中,使用ResNet作为骨干网络,本文使用最新的VMamba(VisualStateSpaceModel)替换ResNet作为RT-DETR的骨干网络。VMamba是一种全新的视觉框架,VMamba结合了CNNs和ViTs的优势,同时优化了计算效率,能够在保持全局感受野的情况下实......
  • 获取在excel中各种格式的日期单元格的年月部分 (VBA代码)
    公共部分  -->开始按钮PrivateSubCommandButton1_Click()DimaryALLData,colNamesDimcurRowNo,curColNo,iRowCount,iColCountConstcnst_fldRowNo=1Constcnst_BeginDataRowNo=2'----------IfMsgBox("开始执行......
  • 打通前后端流程,案例解读华为云开源低代码引擎解决方案
    本文分享自华为云社区《使用场景级前端解决方案及低代码引擎,助力开发者生产效能提升》,来源:《华为云DTSE》第五期开源专刊当前前端在场景级的前端能力/物料上,业界相关内容/产品较少,并且较分散,基本无基础组件搭配,体验参差,多数专业场景能力/物料仅商用授权;对于场景的构建,开发效率与......
  • .NET 代码混淆工具-JIEJIE.NETWX
    阅读目录前言项目介绍项目功能项目效果:蓝猫机场项目地址最后前言JIEJIE.NET是一款强大的开源.NET程序集混淆工具。它利用深度加密技术和多样化的混淆策略,有效地保护了.NET软件的版权和源代码安全,防止未经授权的访问和篡改。项目介绍JIEJIE.NET是一个用C#开发的开源.N......
  • 【学习笔记】Git代码管理手册与协同开发(全网最全Git教程)
    目录一.简介与环境搭建        n.注册账户二.基本操作 1.创建和提交2.版本回退3.查看工作区状态4.撤销修改5.删除文件三.协同开发1.远程仓库配置公钥:新建仓库:关联远程仓库:推送到远程仓库: 从远程仓库拉取: 删除远程仓库:从远程库克隆工程:2.分支管理......
  • 代码随想录算法训练营第九天|344.反转字符串, 541. 反转字符串II,卡码网:54.替换数字
    344.反转字符串反转字符串比较简单,除了用reverse,可以用for循环,两头向中间夹,进行swapclassSolution{public:voidreverseString(vector<char>&s){inthalf=s.size()/2;intlength=s.size();for(inti=0,j=length-1;i<half;i++,j--){......
  • 深入理解Python的生成器与迭代器:编写高效的代码
    深入理解Python的生成器与迭代器:编写高效的代码在Python编程中,生成器(Generators)和迭代器(Iterators)是编写高效代码的重要工具。它们帮助我们节省内存、优化性能,尤其在处理大数据时表现尤为出色。这篇博客将深入探讨生成器与迭代器的工作原理、如何使用它们编写高效代码,并通......