Added custom fonts support (#362)

ref DES-971
This commit is contained in:
Sodbileg Gansukh 2024-11-14 19:08:13 +08:00 committed by GitHub
parent c55f9acfd2
commit 26d7651106
3 changed files with 42 additions and 47 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -154,12 +154,12 @@ hr {
line-height: 1.2; line-height: 1.2;
} }
.has-serif-font .gh-about-primary { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-about-primary {
font-family: var(--font-serif); font-family: var(--gh-font-heading, var(--font-serif));
} }
.has-mono-font .gh-about-primary { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-about-primary {
font-family: var(--font-mono); font-family: var(--gh-font-heading, var(--font-mono));
} }
.gh-about-primary a { .gh-about-primary a {
@ -173,12 +173,12 @@ hr {
letter-spacing: -0.008em; letter-spacing: -0.008em;
} }
.has-serif-font .gh-about-secondary { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-about-secondary {
font-family: var(--font-serif); font-family: var(--gh-font-body, var(--font-serif));
} }
.has-mono-font .gh-about-secondary { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-about-secondary {
font-family: var(--font-mono); font-family: var(--gh-font-body, var(--font-mono));
} }
.gh-about-primary + .gh-about-secondary { .gh-about-primary + .gh-about-secondary {
@ -343,12 +343,12 @@ hr {
word-break: break-word; word-break: break-word;
} }
.has-serif-font .gh-card-title { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-card-title {
font-family: var(--font-serif); font-family: var(--gh-font-heading, var(--font-serif));
} }
.has-mono-font .gh-card-title { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-card-title {
font-family: var(--font-mono); font-family: var(--gh-font-heading, var(--font-mono));
} }
.gh-card-link:hover .gh-card-title { .gh-card-link:hover .gh-card-title {
@ -488,12 +488,12 @@ hr {
letter-spacing: -0.005em; letter-spacing: -0.005em;
} }
.has-serif-font.has-typographic-feed .gh-card-excerpt { .has-serif-font.has-typographic-feed:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-card-excerpt {
font-family: var(--font-serif); font-family: var(--gh-font-body, var(--font-serif));
} }
.has-mono-font.has-typographic-feed .gh-card-excerpt { .has-mono-font.has-typographic-feed:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-card-excerpt {
font-family: var(--font-mono); font-family: var(--gh-font-body, var(--font-mono));
} }
.has-typographic-feed .gh-card-meta { .has-typographic-feed .gh-card-meta {
@ -651,7 +651,6 @@ hr {
.gh-article-date { .gh-article-date {
margin-top: 4px; margin-top: 4px;
font-size: 1.4rem; font-size: 1.4rem;
font-weight: 480;
color: var(--color-secondary-text); color: var(--color-secondary-text);
} }
@ -688,12 +687,12 @@ hr {
grid-column: 4 / span 6; grid-column: 4 / span 6;
} }
.has-serif-font .gh-article-title { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-article-title {
font-family: var(--font-serif); font-family: var(--gh-font-heading, var(--font-serif));
} }
.has-mono-font .gh-article-title { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-article-title {
font-family: var(--font-mono); font-family: var(--gh-font-heading, var(--font-mono));
} }
.gh-article-excerpt { .gh-article-excerpt {
@ -708,12 +707,12 @@ hr {
grid-column: 4 / span 6; grid-column: 4 / span 6;
} }
.has-serif-font .gh-article-excerpt { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-article-excerpt {
font-family: var(--font-serif); font-family: var(--gh-font-body, var(--font-serif));
} }
.has-mono-font .gh-article-excerpt { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-article-excerpt {
font-family: var(--font-mono); font-family: var(--gh-font-body, var(--font-mono));
} }
.gh-article-excerpt .emoji { .gh-article-excerpt .emoji {
@ -741,16 +740,12 @@ hr {
font-weight: 800; font-weight: 800;
} }
.gh-content > :is(p, ul, ol) { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-content > :is([id], p, ul, ol) {
font-weight: 480; font-family: var(--gh-font-body, var(--font-serif));
} }
.has-serif-font .gh-content > :is([id], p, ul, ol) { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-content > :is([id], p, ul, ol) {
font-family: var(--font-serif); font-family: var(--gh-font-body, var(--font-mono));
}
.has-mono-font .gh-content > :is([id], p, ul, ol) {
font-family: var(--font-mono);
} }
.gh-article-footer { .gh-article-footer {
@ -821,12 +816,12 @@ hr {
letter-spacing: -0.03em; letter-spacing: -0.03em;
} }
.has-serif-font .gh-cta-title { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-cta-title {
font-family: var(--font-serif); font-family: var(--gh-font-heading, var(--font-serif));
} }
.has-mono-font .gh-cta-title { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-cta-title {
font-family: var(--font-mono); font-family: var(--gh-font-heading, var(--font-mono));
} }
.gh-cta .gh-btn { .gh-cta .gh-btn {
@ -847,12 +842,12 @@ hr {
letter-spacing: -0.02em; letter-spacing: -0.02em;
} }
.has-serif-font .gh-navigation { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-navigation {
font-family: var(--font-serif); font-family: var(--gh-font-heading, var(--font-serif));
} }
.has-mono-font .gh-navigation { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-navigation {
font-family: var(--font-mono); font-family: var(--gh-font-heading, var(--font-mono));
} }
/* Comments /* Comments
@ -867,12 +862,12 @@ hr {
font-weight: 800; font-weight: 800;
} }
.has-serif-font .gh-comments-title { .has-serif-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-comments-title {
font-family: var(--font-serif); font-family: var(--gh-font-heading, var(--font-serif));
} }
.has-mono-font .gh-comments-title { .has-mono-font:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]):not([class*=" gh-font-body"]):not([class^="gh-font-body"]) .gh-comments-title {
font-family: var(--font-mono); font-family: var(--gh-font-heading, var(--font-mono));
} }
/* Subscribe /* Subscribe