Skip to content

Commit c002955

Browse files
feat: use variable fonts from fontsources
1 parent 1e317ac commit c002955

File tree

11 files changed

+49
-36
lines changed

11 files changed

+49
-36
lines changed

astro.config.mjs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
11
import { defineConfig } from 'astro/config';
2-
import Unfonts from 'unplugin-fonts/astro'
32

43
// https://astro.build/config
5-
export default defineConfig({
6-
integrations: [
7-
Unfonts({
8-
google: {
9-
families: [
10-
'Material+Icons',
11-
{
12-
name: 'Roboto',
13-
styles: 'wght@300;400;500;700',
14-
},
15-
{
16-
name: 'Nunito',
17-
styles: 'wght@400;600;700;800'
18-
},
19-
],
20-
},
21-
})
22-
]
23-
});
4+
export default defineConfig({});

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
"simplebar": "6.2.5"
3636
},
3737
"devDependencies": {
38+
"@fontsource-variable/nunito": "^5.0.9",
39+
"@fontsource-variable/roboto-flex": "^5.0.8",
40+
"@fontsource/material-icons": "^5.0.7",
3841
"autoprefixer": "10.4.15",
39-
"npm-run-all": "4.1.5",
40-
"unplugin-fonts": "^1.0.3"
42+
"npm-run-all": "4.1.5"
4143
}
4244
}

pnpm-lock.yaml

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/layouts/Default.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
22
import { ViewTransitions } from 'astro:transitions';
3-
import Unfont from 'unplugin-fonts/astro/component.astro';
3+
44
import Sidebar from "../components/Sidebar.astro";
55
import Footer from "../components/Footer.astro";
66
import BackToTop from "../components/BackToTop.astro";
7+
8+
import '@fontsource-variable/nunito/index.css';
9+
import '@fontsource/material-icons/index.css';
10+
import '@fontsource-variable/roboto-flex/index.css';
11+
712
import "simplebar/dist/simplebar.min.css";
813
import "../styles/main.scss";
914
const { title } = Astro.props;
@@ -13,7 +18,6 @@ const { title } = Astro.props;
1318
<html dir="ltr" lang="en">
1419
<head>
1520
<meta charset="UTF-8" />
16-
<Unfont />
1721
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1822
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
1923
<title>Fresh {"- " + title}</title>

src/layouts/Minimal.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
22
import { ViewTransitions } from 'astro:transitions';
3-
import Unfont from 'unplugin-fonts/astro/component.astro';
3+
44
import BackToTop from '../components/BackToTop.astro'
5+
6+
import '@fontsource-variable/nunito';
7+
import '@fontsource/material-icons';
8+
import '@fontsource-variable/roboto-flex';
59
import 'simplebar/dist/simplebar.min.css'
610
import 'plyr/dist/plyr.css'
11+
712
import '../styles/main.scss'
813
const {title} = Astro.props
914
---
@@ -12,7 +17,6 @@ const {title} = Astro.props
1217
<html dir="ltr" lang="en">
1318
<head>
1419
<meta charset="UTF-8" />
15-
<Unfont />
1620
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1721
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
1822
<title>Fresh {'- ' + title}</title>

src/styles/abstracts/_colors.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ $border-grey: #ccc;
3232
$muted-grey: #999;
3333
$section-grey: #fbfbfb;
3434

35-
//Heading font
36-
$font: 'Montserrat', sans-serif !important;
35+
//fonts
36+
$font: 'Roboto Flex', sans-serif !important;
37+
$font-heading: 'Nunito Variable', sans-serif !important;
3738

3839
//Shadow
3940
$light-shadow: -1px 3px 15px 0 rgba(0, 0, 0, 0.06);

src/styles/components/_cards.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Cards and Card content styles
1919
padding: 2.5rem;
2020

2121
.card-title h4 {
22-
font-family: "Nunito", sans-serif;
22+
font-family: $font-heading;
2323
font-size: 1.2rem;
2424
font-weight: 600;
2525
color: $blue-grey;

src/styles/components/_testimonials.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Testimonials Styles
4646
}
4747

4848
blockquote:before {
49-
font-family: "Material Icons";
49+
font-family: "Material Icons", sans-serif;
5050
content: "\e244";
5151
position: absolute;
5252
font-size: 30px;

src/styles/layout/_sections.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Section Styles
33
========================================================================== */
44

55
body {
6-
font-family: "Roboto", sans-serif;
6+
font-family: $font;
77
}
88

99
h1,
@@ -12,7 +12,7 @@ h3,
1212
h4,
1313
h5,
1414
h6 {
15-
font-family: "Nunito", sans-serif;
15+
font-family: $font-heading;
1616
}
1717

1818
//Sections
@@ -47,7 +47,7 @@ h6 {
4747

4848
.title,
4949
.subtitle {
50-
font-family: "Nunito", sans-serif;
50+
font-family: $font-heading;
5151
}
5252

5353
.subtitle {
@@ -73,7 +73,7 @@ h6 {
7373

7474
.title,
7575
.subtitle {
76-
font-family: "Nunito", sans-serif;
76+
font-family: $font-heading;
7777
}
7878

7979
.subtitle {

src/styles/layout/_sidebar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Sidebar Styles
146146
max-width: 400px;
147147
list-style: none;
148148
list-style-type: none;
149-
font-family: "Roboto", sans-serif !important;
149+
font-family: $font;
150150

151151
li {
152152
position: relative;

0 commit comments

Comments
 (0)