关于自定义代码配色 #1713
Replies: 2 comments
-
Hi @berrylium0078! I'm Dosu and I’m helping the hexo-theme-butterfly team. 你的 [data-theme="dark"] 方法是完全合法的,Butterfly 主题本身就是通过这个选择器来实现日夜模式切换和代码块配色的,这也是官方推荐的做法,已经有不少组件(比如 note)都用这种方式适配深色模式,完全可以收录进文档作为自定义配色的参考方案。参考 关于代码块高亮行背景色,目前 Butterfly 主题用的是 SCSS 变量 如果希望未来能通过配置项自定义高亮行背景色,需要主题作者增加相关配置支持,目前只能通过自定义样式实现。你现在的做法是主流方案之一。 To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
我自己实验了一下,拿 catppuccin 做了一个支持日夜模式的代码块配色(highlight.js):https://gist.github.com/berrylium0078/10382e0442390d6b79d757a3661aed2c
想问一下各位大佬,
Beta Was this translation helpful? Give feedback.
All reactions