【发布时间】:2016-03-29 02:05:33
【问题描述】:
我正在玩 Jekyll,并且已经能够更改我网站的背景颜色。但是,无论我在_syntax-highlighting.scss 中更改哪个背景或背景颜色属性,我仍然得到相同的浅灰色背景(即使我重新启动了jekyll 服务器)。
在我看来,没有任何 css/sass 默认文件是显而易见的。
【问题讨论】:
我正在玩 Jekyll,并且已经能够更改我网站的背景颜色。但是,无论我在_syntax-highlighting.scss 中更改哪个背景或背景颜色属性,我仍然得到相同的浅灰色背景(即使我重新启动了jekyll 服务器)。
在我看来,没有任何 css/sass 默认文件是显而易见的。
【问题讨论】:
_sass/base.scss 并更改 pre, code 规则:
pre,
code {
...
background-color: #eef;
}
【讨论】:
David Jacquel 给出的答案对我不起作用。
对我有用的是以下;
转到此文件/static/css/main.css 并更改pre 的参数。
Background 是代码块的背景颜色,color 是其中的字体颜色。
不知何故,.highlight 参数优于 pre 参数。我也注释掉了.highlight 部分。这就是最终代码的样子。
/* Content */
div.content pre {
background: #d42525;
padding: 10px;
color: rgb(20, 199, 29);
overflow-x: auto;
font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
font-size: 12px;
border: none;
}
/* Removed this part to be able to change background of "pre" */
/* div.content .highlight {
background: #333333;
} */
您可以使用here 中的这些参数查看代码块的外观
【讨论】: