From 53baedb9791717b63e1d096a8007d8d42cd44fdf Mon Sep 17 00:00:00 2001 From: Fynn Becker Date: Fri, 28 Jun 2024 21:46:24 +0200 Subject: [PATCH] feat(css): Reduce number of bundles (close #58) --- README.md | 8 -- components/{page-base.webc => base-page.webc} | 58 +++++++---- components/element-icon.webc | 4 +- components/element-meta.webc | 4 +- components/element-nav.webc | 8 +- components/element-rich-text.webc | 31 ++---- components/element-tags.webc | 4 +- components/global-footer.webc | 9 +- components/global-header.webc | 15 ++- components/global-hero.webc | 4 +- components/global-related.webc | 4 +- .../2022-01-30-browser-image-performance.md | 4 +- ...-23-accessibility-is-not-a-tech-problem.md | 2 +- ...6-forced-colors-windows-contrast-themes.md | 2 +- eleventy.config.js | 22 +---- eleventy/transforms/bundle-css-layer.js | 22 +++++ generate-fonts-fallback.js | 32 ------ layouts/default.webc | 4 +- layouts/gallery.webc | 8 +- layouts/post.webc | 8 +- layouts/tag.webc | 8 +- layouts/tags.webc | 8 +- package-lock.json | 26 ----- package.json | 2 - public/css/global/base.css | 15 +-- public/css/global/fonts-fallback.css | 49 --------- public/css/main.css | 20 +--- public/css/tokens/sizes.css | 4 +- public/css/tokens/typo.css | 6 +- public/css/typography/code.css | 99 +++++++++---------- public/css/typography/table.css | 27 +++++ public/css/utilities.css | 21 ++++ public/css/utilities/container.css | 7 -- public/css/utilities/list.css | 3 - public/css/utilities/scroll.css | 3 - 35 files changed, 246 insertions(+), 305 deletions(-) rename components/{page-base.webc => base-page.webc} (78%) create mode 100644 eleventy/transforms/bundle-css-layer.js delete mode 100644 generate-fonts-fallback.js delete mode 100644 public/css/global/fonts-fallback.css create mode 100644 public/css/typography/table.css create mode 100644 public/css/utilities.css delete mode 100644 public/css/utilities/container.css delete mode 100644 public/css/utilities/list.css delete mode 100644 public/css/utilities/scroll.css diff --git a/README.md b/README.md index 14e36fe..d826165 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,6 @@ node --run dev node --run build ``` -## Fonts - -Generate fonts fallback CSS file: - -```sh -node generate-fonts-fallback.js -``` - ## Formatting ```sh diff --git a/components/page-base.webc b/components/base-page.webc similarity index 78% rename from components/page-base.webc rename to components/base-page.webc index becbb4e..575209b 100644 --- a/components/page-base.webc +++ b/components/base-page.webc @@ -8,15 +8,47 @@ @text="isHomePage($data.page.url) ? 'Fynn Becker' : `${$data.title} - Fynn Becker`" > + + + + + + + + + + + + + - + + + + @@ -37,6 +71,8 @@ + + - - - - - @@ -72,8 +91,11 @@

+ + + diff --git a/components/element-icon.webc b/components/element-icon.webc index 4d4da31..fe8aba3 100644 --- a/components/element-icon.webc +++ b/components/element-icon.webc @@ -21,7 +21,9 @@ - diff --git a/components/global-header.webc b/components/global-header.webc index 98502b1..79972fb 100644 --- a/components/global-header.webc +++ b/components/global-header.webc @@ -4,12 +4,25 @@ - diff --git a/components/global-hero.webc b/components/global-hero.webc index 5793068..a1bda17 100644 --- a/components/global-hero.webc +++ b/components/global-hero.webc @@ -27,7 +27,9 @@ > -