use mono font with code
This commit is contained in:
parent
a554e40541
commit
d271f37f33
2 changed files with 23 additions and 15 deletions
|
|
@ -715,8 +715,18 @@ func embedFonts(buf *bytes.Buffer) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if strings.Contains(content, `class="text-mono"`) {
|
|
||||||
fmt.Fprintf(buf, `
|
triggers = []string{
|
||||||
|
`class="text-mono"`,
|
||||||
|
`<pre>`,
|
||||||
|
`<code>`,
|
||||||
|
`<kbd>`,
|
||||||
|
`<samp>`,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, t := range triggers {
|
||||||
|
if strings.Contains(content, t) {
|
||||||
|
fmt.Fprintf(buf, `
|
||||||
.text-mono {
|
.text-mono {
|
||||||
font-family: "font-mono";
|
font-family: "font-mono";
|
||||||
}
|
}
|
||||||
|
|
@ -724,7 +734,9 @@ func embedFonts(buf *bytes.Buffer) {
|
||||||
font-family: font-mono;
|
font-family: font-mono;
|
||||||
src: url("%s");
|
src: url("%s");
|
||||||
}`,
|
}`,
|
||||||
d2fonts.FontEncodings[d2fonts.SourceCodePro.Font(0, d2fonts.FONT_STYLE_REGULAR)])
|
d2fonts.FontEncodings[d2fonts.SourceCodePro.Font(0, d2fonts.FONT_STYLE_REGULAR)])
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.WriteString(`]]></style>`)
|
buf.WriteString(`]]></style>`)
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,14 @@
|
||||||
font-family: "font-bold";
|
font-family: "font-bold";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.md code,
|
||||||
|
.md kbd,
|
||||||
|
.md pre,
|
||||||
|
.md samp {
|
||||||
|
font-family: "font-mono";
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
/* based on https://github.com/sindresorhus/github-markdown-css */
|
/* based on https://github.com/sindresorhus/github-markdown-css */
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
.md {
|
.md {
|
||||||
|
|
@ -131,14 +139,6 @@
|
||||||
background-color: var(--color-canvas-default);
|
background-color: var(--color-canvas-default);
|
||||||
}
|
}
|
||||||
|
|
||||||
.md code,
|
|
||||||
.md kbd,
|
|
||||||
.md pre,
|
|
||||||
.md samp {
|
|
||||||
font-family: monospace, monospace;
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.md figure {
|
.md figure {
|
||||||
margin: 1em 40px;
|
margin: 1em 40px;
|
||||||
}
|
}
|
||||||
|
|
@ -343,16 +343,12 @@
|
||||||
|
|
||||||
.md tt,
|
.md tt,
|
||||||
.md code {
|
.md code {
|
||||||
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
|
|
||||||
monospace;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.md pre {
|
.md pre {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
|
|
||||||
monospace;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue