0%

Typora自定义主题&主题推荐

  1. 1 主题推荐
    1. 1.1 Mo
    2. 1.2 Gitbook
    3. 1.3 Onedark
  2. 2 Typora自定义主题
  3. 3 修改主题样式
    1. 3.1 Gitbook

1 主题推荐

Typora官方提供了一个主题汇总( http://theme.typora.io/ )可以自行前往下载,稍微筛选了一下,挑选了三款适合自己的主题。

1.1 Mo

Typora主题链接:http://theme.typora.io/theme/Mo/

Github:https://github.com/MarMomento/typora-mo-theme

Download:https://github.com/MarMomento/typora-mo-theme/releases/latest

评价:有亮暗两种主题,整体效果较为霸气,文字屏幕占比较高,代码显示花里胡哨,辨识度极高。标题居中可能有会逼死强迫症,不过用来阅读大量文字的话整体效果很好。

image-20201027204112332

image-20201027204020765

1.2 Gitbook

Typora主题链接:http://theme.typora.io/theme/Gitbook/

GitHub:https://github.com/Henning16/typora-gitbook-theme

Download:https://github.com/Henning16/typora-gitbook-theme/releases/latest

评价:有三种主题,分别为蓝白(Azure)/青白(Teal)/蓝黑(Slate),偏简约风,

image-20201027204532818

image-20201027204549734

image-20201027204616593

1.3 Onedark

Typora链接:http://theme.typora.io/theme/OneDark/

GitHub:https://github.com/sweatran/typora-onedark-theme

Download:https://github.com/sweatran/typora-onedark-theme/releases/latest

评价:只有一种配色,就是黑色,整体给人一种严谨、肃穆、深沉的感觉,能有效降低屏幕亮度;代码块色彩的样式丰富,与整体色彩风格搭配恰到好处。

image-20201027204738050

image-20201027204939736

image-20201027205029943

2 Typora自定义主题

将主题文件的压缩包下载下来之后,将解压出来的文件夹(如果有)和.css文件解压到Typora的主题文件夹下(文件-偏好设置-外观-主题-打开主题文件夹),重启Typora,就可以在“主题(T)”查看导入的主题。

image-20201027205747671

这个主题列表是根据.css文件生成的,有的主题(如Gitbook)有种色系,也通过.css控制。

image-20201027205919415

3 修改主题样式

看来看去,发现不同的主题各有优缺点,很难有一款面面俱到,最终决定对每一款主题进行修改,改成自己想要的样子,在此记录修改的内容。

3.1 Gitbook

这部分内容的修改需要分别写入到三个文件中:gitbook-azure.css, gitbook-slate.css, gitbook-teal.css

  • 图片:去除原有的白色边框,加上box-shadow
  • 倾斜:加上下划线
  • 代码:改成鲜艳色调
  • 宽度:最大宽度限定由850px改为75%
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* 自定义样式 */
#write img {
box-shadow: 1px 1px 3px 1px #aaa;
border: none;
}
#write em {
font-size: 0.8em;
margin: 0 5px;
border-bottom: 1px dashed #666;
}
#write code {
border-radius: 5px;
padding: 0px 4px;
margin: 0px 3px;
font-size: 0.8em;
color: #e96900;
}
#write {
max-width: 75%;
}
/* 自定义样式结束 */