Skip to content

Commit 6ecfae2

Browse files
committed
perf: avoid css.import
1 parent b396047 commit 6ecfae2

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

lib/jaspr_options.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import 'package:jaspr/jaspr.dart';
88
import 'package:saber_landing/components/rough_notation_initiator.dart'
99
as prefix0;
10-
import 'package:saber_landing/pages/home.dart' as prefix1;
11-
import 'package:saber_landing/pages/support.dart' as prefix2;
1210

1311
/// Default [JasprOptions] for use with your jaspr project.
1412
///
@@ -33,5 +31,4 @@ JasprOptions get defaultJasprOptions => JasprOptions(
3331
'components/rough_notation_initiator',
3432
),
3533
},
36-
styles: () => [...prefix1.Home.styles, ...prefix2.Support.styles],
3734
);

lib/pages/home.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ class Home extends StatelessComponent {
1010
@override
1111
Component build(BuildContext context) {
1212
return fragment([
13+
link(href: '/home.css', rel: 'stylesheet'),
1314
Header(),
1415
Badges(),
1516
Features(),
1617
const RoughNotationInitiator(),
1718
]);
1819
}
19-
20-
@css
21-
static List<StyleRule> get styles => [css.import('/home.css')];
2220
}

lib/pages/support.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Support extends StatelessComponent {
88
@override
99
Component build(BuildContext context) {
1010
return fragment([
11+
link(href: '/support.css', rel: 'stylesheet'),
1112
h1([text('Support with Saber')]),
1213
p([
1314
text(
@@ -56,7 +57,4 @@ class Support extends StatelessComponent {
5657
]),
5758
]);
5859
}
59-
60-
@css
61-
static List<StyleRule> get styles => [css.import('/support.css')];
6260
}

0 commit comments

Comments
 (0)