From 67fcfdb051f76a174c4b80c398051d5ce4593b40 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Tue, 2 Jan 2024 13:49:47 -0800 Subject: [PATCH] chore: split out styles + only load where needed --- src/_includes/now.liquid | 6 + src/_includes/partials/now/media-grid.liquid | 6 + .../partials/now/progress-bar.liquid | 6 + src/_includes/partials/paginator.liquid | 6 + src/_includes/partials/popular-posts.liquid | 6 + .../partials/webmentions/container.liquid | 6 + src/_includes/post.liquid | 1 + src/assets/styles/index.css | 473 +----------------- src/assets/styles/pages/404.css | 7 + src/assets/styles/pages/about.css | 32 ++ src/assets/styles/pages/contact.css | 28 ++ src/assets/styles/pages/now.css | 37 ++ src/assets/styles/pages/post.css | 26 + src/assets/styles/pages/webrings.css | 8 + src/assets/styles/widgets/forms.css | 37 ++ src/assets/styles/widgets/media-grid.css | 101 ++++ src/assets/styles/widgets/paginator.css | 26 + src/assets/styles/widgets/popular-posts.css | 4 + src/assets/styles/widgets/post-graph.css | 6 + src/assets/styles/widgets/progress-bar.css | 24 + src/assets/styles/widgets/webmentions.css | 120 +++++ src/pages/404.html | 6 + src/pages/about.md | 6 + src/pages/contact.md | 7 + src/pages/search.html | 1 + src/pages/webrings.md | 7 +- 26 files changed, 539 insertions(+), 454 deletions(-) create mode 100644 src/assets/styles/pages/404.css create mode 100644 src/assets/styles/pages/about.css create mode 100644 src/assets/styles/pages/contact.css create mode 100644 src/assets/styles/pages/now.css create mode 100644 src/assets/styles/pages/post.css create mode 100644 src/assets/styles/pages/webrings.css create mode 100644 src/assets/styles/widgets/forms.css create mode 100644 src/assets/styles/widgets/media-grid.css create mode 100644 src/assets/styles/widgets/paginator.css create mode 100644 src/assets/styles/widgets/popular-posts.css create mode 100644 src/assets/styles/widgets/progress-bar.css create mode 100644 src/assets/styles/widgets/webmentions.css diff --git a/src/_includes/now.liquid b/src/_includes/now.liquid index 5bd2144a..e03a8b18 100644 --- a/src/_includes/now.liquid +++ b/src/_includes/now.liquid @@ -1,6 +1,12 @@ --- layout: default --- +{% capture css %} + {% render "../assets/styles/pages/now.css" %} +{% endcapture %} + {{ content }} {% render "partials/now/media-grid.liquid", data:artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8, loading: 'eager' %} {% render "partials/now/media-grid.liquid", data:albums, icon: "vinyl", title: "Albums", shape: "square", count: 8 %} diff --git a/src/_includes/partials/now/media-grid.liquid b/src/_includes/partials/now/media-grid.liquid index 72722018..08240b72 100644 --- a/src/_includes/partials/now/media-grid.liquid +++ b/src/_includes/partials/now/media-grid.liquid @@ -1,4 +1,10 @@ {% if data.size > 0 %} + {% capture css %} + {% render "../../../assets/styles/widgets/media-grid.css" %} + {% endcapture %} + {% assign media = data | normalizeMedia %}

{% tablericon icon title %} diff --git a/src/_includes/partials/now/progress-bar.liquid b/src/_includes/partials/now/progress-bar.liquid index 71a85feb..2969c421 100644 --- a/src/_includes/partials/now/progress-bar.liquid +++ b/src/_includes/partials/now/progress-bar.liquid @@ -1,4 +1,10 @@ {% if percentage %} +{% capture css %} + {% render "../../../assets/styles/widgets/media-grid.css" %} +{% endcapture %} +
diff --git a/src/_includes/partials/paginator.liquid b/src/_includes/partials/paginator.liquid index bbb14296..02081718 100644 --- a/src/_includes/partials/paginator.liquid +++ b/src/_includes/partials/paginator.liquid @@ -1,3 +1,9 @@ +{% capture css %} + {% render "../../assets/styles/widgets/paginator.css" %} +{% endcapture %} +