当前位置: 首页 > article >正文

Typora-macOS 风格代码块

效果:

替换 Typora安装目录中 themes 文件夹下的  base.user.css 文件,直接替换即可,建议先备份。

css:

/* ================= 语法高亮配色 ================= */
.CodeMirror-line .cm-number { color: #b5cea8; }       /* 数字 - 浅绿色 */
.CodeMirror-line .cm-property { color: #9cdcfe; }    /* 属性 - 浅蓝色 */
.CodeMirror-line .cm-variable-3 { color: #4ec9b0; }  /* 类型/返回值 - 青蓝色 */
.CodeMirror-line .cm-qualifier { color: #d7ba7d; }   /* 限定符 - 金色 */
.CodeMirror-line .cm-variable-2 { color: #9cdcfe; }  /* 变量 - 浅蓝色 */
.CodeMirror-line .cm-meta { color: #569cd6; }        /* 宏/头文件 - 蓝色 */
.CodeMirror-line .cm-atom { color: #569cd6; }        /* true/false - 蓝色 */
.CodeMirror-line .cm-keyword { color: #c586c0; }     /* 关键字 - 紫色 */
.CodeMirror-line .cm-def { color: #dcdcaa; }         /* 函数定义 - 浅黄色 */
.CodeMirror-line .cm-variable { color: #9cdcfe; }    /* 变量 - 浅蓝色 */
.CodeMirror-line .cm-builtin { color: #dcdcaa; }     /* 内置函数 - 浅黄色 */
.CodeMirror-line .cm-comment { color: #6a9955;                  /* 注释 - 绿色 */
}
.CodeMirror-line .cm-string { color: #ce9178; }      /* 字符串 - 橙红色 */
.CodeMirror-line .cm-string-2 { color: #ce9178; }    /* 模板字符串 - 橙红色 */
.CodeMirror-line .cm-operator { color: #d4d4d4; }    /* 操作符 - 白色 */
.CodeMirror-line .cm-tag { color: #569cd6; }         /* HTML标签 - 蓝色 */
.CodeMirror-line .cm-bracket { color: #808080; }     /* 括号 - 灰色 */
.CodeMirror-line .cm-attribute { color: #9cdcfe; }   /* HTML属性 - 浅蓝色 *//* 计数器相关的CSS规则 如需要可启用 */
/*
.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;
}

http://www.lryc.cn/news/2393148.html

相关文章:

  • 如何迁移SOS数据库和修改sos服务的端口号
  • ansible自动化playbook简单实践
  • 20250526惠普HP锐14 AMD锐龙 14英寸轻薄笔记本电脑(八核R7-7730U)的显卡驱动下载
  • WIN11使用vscode搭建c语言开发环境
  • 2025年5月蓝桥杯stema省赛真题——象棋移动
  • AI重构SEO关键词精准定位
  • C++ 模板元编程语法大全
  • SPSS跨域分类:自监督知识+软模板优化
  • 【术语扫盲】BSP与MSP
  • vscode的Embedded IDE创建keil项目找不到源函数或者无法跳转
  • HTTP/2与HTTP/3特性详解:为你的Nginx/Apache服务器开启下一代Web协议
  • 构建高效智能客服系统的8大体验设计要点
  • CppCon 2014 学习:Making C++ Code Beautiful
  • 副本(Replica)在Elasticsearch中扮演什么角色?
  • 据传苹果将在WWDC上发布iOS 26 而不是iOS 19
  • 整理了Windows(7—11)官方镜像下载链接和各版本区别介绍
  • 数据库主键与索引详解
  • RTOS:启动调度器的作用(含源码逐行解读)
  • 【Python 进阶】抽象基类(Abstract Base Class)
  • Armv7l或树莓派32位RPI 4B编译faiss
  • 嵌入式开发STM32 -- 江协科技笔记
  • [网页五子棋][用户模块]客户端开发(登录功能和注册功能)
  • nt!MiInitializeSystemCache函数分析之PointerPte->u.List.NextEntry的由来
  • MQTT协议,EMQX部署,MQTTX安装学习
  • 如何理解UDP 和 TCP 区别 应用场景
  • 60天python训练计划----day40
  • 干泵,干式螺杆真空泵
  • Tailwind CSS 实战:基于 Kooboo 构建 AI 对话框页面(五):语音合成输出与交互增强
  • 职业本科院校无人机专业人才培养解决方案
  • 利用机器学习优化数据中心能效