refactor(fonts)!: add `font-code` to let managing code fonts more flexible

This commit is contained in:
郭桓桓 2023-03-04 17:19:15 +08:00
parent 213ea5f44f
commit a365317c85
Signed by: kuohuanhuan
GPG Key ID: FD846A0A797B0D75
4 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,7 @@
.highlight { .highlight {
margin: .5rem 0; margin: .5rem 0;
font-size: 1.05rem; font-size: 1.05rem;
font-family: var(--xm-font-mono) !important; font-family: var(--xm-font-code) !important;
line-height: 1.4; line-height: 1.4;
&.shiki-light { &.shiki-light {
background: var(--xm-c-shiki-light) !important; background: var(--xm-c-shiki-light) !important;

View File

@ -2,7 +2,7 @@ code {
color: var(--xm-c-deep); color: var(--xm-c-deep);
font-weight: 600; font-weight: 600;
font-size: .875rem; font-size: .875rem;
font-family: var(--xm-font-mono); font-family: var(--xm-font-code);
&::before, &::before,
&::after { &::after {
content: '`'; content: '`';

View File

@ -5,12 +5,14 @@ $figcaption: #6b7280;
$thead: #111827; $thead: #111827;
$ol-counter: #6b7280; $ol-counter: #6b7280;
$ul-counter: #d1d5db; $ul-counter: #d1d5db;
// Border // Border
$link-border: hsla(0deg 0% 50% / .3); $link-border: hsla(0deg 0% 50% / .3);
$hr-border: hsla(0deg 0% 50% / .3); $hr-border: hsla(0deg 0% 50% / .3);
$quote-border: hsla(0deg 0% 50% / .3); $quote-border: hsla(0deg 0% 50% / .3);
$thead-border: #d1d5db; $thead-border: #d1d5db;
$tr-border: #e5e7eb; $tr-border: #e5e7eb;
// Shiki (code highlight) // Shiki (code highlight)
$shiki-light: #f8f8f8; $shiki-light: #f8f8f8;
$shiki-dark: #0e0e0e; $shiki-dark: #0e0e0e;

View File

@ -1,5 +1,8 @@
// Font stack
$font-sans: 'Open Sans', 'Inter', 'Roboto', 'Helvetica', 'Arial', 'Sarasa Gothic TC', 'Sarasa Gothic SC', 'Noto Sans TC', 'Noto Sans SC', 'Microsoft JhengHei', 'Microsoft YaHei', -apple-system, sans-serif; $font-sans: 'Open Sans', 'Inter', 'Roboto', 'Helvetica', 'Arial', 'Sarasa Gothic TC', 'Sarasa Gothic SC', 'Noto Sans TC', 'Noto Sans SC', 'Microsoft JhengHei', 'Microsoft YaHei', -apple-system, sans-serif;
$font-serif: 'Merriweather', 'Georgia', 'Times New Roman', 'Times', 'Source Han Serif Traditional Chinese', 'Source Han Serif Simplified Chinese', 'Noto Serif TC', 'Noto Serif SC', serif; $font-serif: 'Merriweather', 'Georgia', 'Times New Roman', 'Times', 'Source Han Serif Traditional Chinese', 'Source Han Serif Simplified Chinese', 'Noto Serif TC', 'Noto Serif SC', serif;
$font-mono: 'DM Mono', 'Fira Code', 'Jetbrains Mono', 'Input Mono', 'Menlo', 'MesloLGS NF', 'Ubuntu', monospace; $font-mono: 'DM Mono', 'Fira Code', 'Jetbrains Mono', 'Input Mono', 'Menlo', 'MesloLGS NF', 'Ubuntu', monospace;
// Font defaults
$font-display: var(--xm-font-sans); $font-display: var(--xm-font-sans);
$font-code: var(--xm-font-mono);