Skip to content

Commit

Permalink
feat: use nanum brush script font for headers (#239)
Browse files Browse the repository at this point in the history
* feat: use nanum brush script font for headers

* chore: skip cascadia font for reduced-data
  • Loading branch information
Th3S4mur41 authored Aug 17, 2021
1 parent d10ecc2 commit 5a02f66
Show file tree
Hide file tree
Showing 8 changed files with 21,880 additions and 81 deletions.
21,925 changes: 21,850 additions & 75 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"homepage": "https://th3s4mur41.me",
"dependencies": {
"@fontsource/cascadia-code": "^4.2.1",
"@fontsource/nanum-brush-script": "^4.5.0",
"postcss-preset-env": "^6.7.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<!-- Preload-->
<link
rel="preload"
href="~@fontsource/cascadia-code/files/cascadia-code-latin-ext-400-normal.woff2"
href="~@fontsource/nanum-brush-script/files/nanum-brush-script-latin-400-normal.woff2"
as="font"
type="font/woff2"
crossorigin
Expand Down
13 changes: 13 additions & 0 deletions src/styles/elements/h.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Nanum Brush Script', 'Nanum Brush Script-fallback';
font-weight: 600;
}

h1 {
font-size: clamp(3.5rem, 12vw, 10rem);
}
2 changes: 1 addition & 1 deletion src/styles/generic/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body {

body {
font-size: var(--default-font-size);
font-family: 'Cascadia Code', monospace;
font-family: monospace;
background-color: var(--primary-background-color);
color: var(--primary-color);
accent-color: var(--theme-color);
Expand Down
2 changes: 0 additions & 2 deletions src/styles/generic/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ body {
align-items: center;
gap: 0.5em;
margin-block: 1em;
font-size: clamp(2rem, 8vw, 5rem);
color: var(--theme-color);
text-shadow: 0.1rem 0.1rem 0.2rem var(--primary-background-color);

Expand All @@ -41,7 +40,6 @@ body {
}
> h1 {
margin: 0;
font-size: inherit;
}
}

Expand Down
15 changes: 13 additions & 2 deletions src/styles/settings/fonts.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
@import '~@fontsource/cascadia-code/index.css';
@import '~@fontsource/nanum-brush-script/latin.css';

@media (prefers-redduced-data: no-preference) {
@import '~@fontsource/cascadia-code/index.css';
}

@font-face {
font-family: 'Nanum Brush Script-fallback';
size-adjust: 75.32000000000005%;
ascent-override: 126%;
src: local('Arial');
}

@font-face {
font-family: 'monospace';
font-family: 'Cascadia Code-fallback';
advance-override: 0.0375; // stylelint-disable-line property-no-unknown
src: local('monospace');
}
Expand Down
1 change: 1 addition & 0 deletions src/styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

/* Elements */
@import 'elements/a.scss';
@import 'elements/h.scss';
@import 'elements/svg.scss';

/* Components */
Expand Down

0 comments on commit 5a02f66

Please sign in to comment.