请问下如何设置 代码块大小,
想让代码大小略小于正文内容。
个人调试了一下,结果导致 代码块的自动换行被 hidden 了。
我自己用的css部分,供参考:
/* NOTE 代码部分 */
/* 实时预览模式行内代码字体修正 */
.theme-light .cm-s-obsidian span.cm-inline-code {
font-size: 1.04em;
color: var(--mlk255-light-theme-color);
/* background-color: #212933; */
}
.theme-dark .cm-s-obsidian span.cm-inline-code {
font-size: 1.04em;
/* color: #2395f9; */
color: var(--link-color);
/* background-color: #212933; */
}
/* 实时预览模式代码块字体修正 */
.cm-s-obsidian .HyperMD-codeblock {
font-size: 1.02em;
line-height: normal;
border-left: 2px solid var(--mlk255-light-theme-color);
}
/* 实时预览模式代码块行号 */
.HyperMD-codeblock-begin {
counter-reset: line-numbers;
}
.HyperMD-codeblock.cm-line:not(.HyperMD-codeblock-begin):not(.HyperMD-codeblock-end) {
padding-left: 1.5em;
position: relative;
}
.HyperMD-codeblock.cm-line:not(.HyperMD-codeblock-begin):not(.HyperMD-codeblock-end)::after {
align-items: flex-start;
color: var(--text-faint);
content: counter(line-numbers);
counter-increment: line-numbers;
display: flex;
font-size: 0.8em;
/* height: 100%; */
justify-content: flex-end;
left: 0;
position: absolute;
width: 1.4em;
/* padding-bottom: 1em; */
/* padding-right: 0.5em; */
bottom: 0.05em;
/* border-right: 2px solid var(--scrollbar-thumb-bg); */
white-space: nowrap;
}
.theme-dark .HyperMD-codeblock.cm-line.cm-active:not(.HyperMD-codeblock-begin):not(.HyperMD-codeblock-end)::after {
color: #FFFFFF;
}
.theme-light .HyperMD-codeblock.cm-line.cm-active:not(.HyperMD-codeblock-begin):not(.HyperMD-codeblock-end)::after {
color: var(--mlk255-light-theme-color);
font-weight: 700;
}
.HyperMD-codeblock .cm-foldPlaceholder::before {
display: none;
}
/* 阅读模式代码字体修正 */
.markdown-rendered code {
font-size: 1.04em;
/* 无法对行内代码和代码块分别作出修改,只能同时修改 */
}