Skip to content

Commit 47f91c5

Browse files
committed
perf: asynchronously load fonts
1 parent d239b2a commit 47f91c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/main.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ void main() {
99
title: 'Saber',
1010
lang: 'en',
1111
styles: [
12-
css.import('https://fonts.googleapis.com/css?family=Neucha'),
1312
css.import('/globals.css'),
14-
css.import(
15-
'https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&display=swap'),
1613
],
1714
meta: const {
1815
'color-scheme': 'light dark',
@@ -28,6 +25,10 @@ void main() {
2825
'href': 'https://fonts.gstatic.com',
2926
'crossorigin': '',
3027
}),
28+
Component.element(tag: 'link', attributes: {
29+
'href': 'https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&family=Neucha&display=swap',
30+
'rel': 'stylesheet',
31+
}),
3132
Component.element(
3233
tag: 'link',
3334
attributes: {'rel': 'icon', 'href': '/favicon.ico'},

0 commit comments

Comments
 (0)