From cdabe6935ba25aefaef67468910202bb889a96e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Wed, 22 Jun 2022 23:25:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Huge=20style=20refactoring=20by?= =?UTF-8?q?=20using=20SvelteKit=20built-in=20style=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's been tricky but got there finally! Hello `:global` - Avoid using one global CSS file containing everything - Import the component SCSS file in a script tag from the component file to allow style scoping and including it only when used --- src/components/atoms/Badge.svelte | 4 + src/components/atoms/BoxCTA.svelte | 4 + src/components/atoms/Button.svelte | 4 + src/components/atoms/ButtonCart.svelte | 4 + src/components/atoms/ButtonCircle.svelte | 4 + src/components/atoms/DiscoverText.svelte | 4 + src/components/atoms/IconArrow.svelte | 4 + src/components/atoms/IconEarth.svelte | 8 + src/components/atoms/ScrollingTitle.svelte | 8 + src/components/atoms/SiteTitle.svelte | 4 + src/components/layouts/PosterLayout.svelte | 4 + src/components/molecules/CartItem.svelte | 4 + src/components/molecules/EmailForm.svelte | 4 + src/components/molecules/Heading.svelte | 4 + src/components/molecules/House.svelte | 4 + src/components/molecules/Location.svelte | 8 +- .../molecules/NotificationCart.svelte | 4 + src/components/molecules/Pagination.svelte | 23 + src/components/molecules/PhotoCard.svelte | 4 + src/components/molecules/PostCard.svelte | 4 + src/components/molecules/Poster.svelte | 4 + .../molecules/ShopLocationSwitcher.svelte | 4 + src/components/molecules/Switcher.svelte | 4 + src/components/organisms/Carousel.svelte | 4 + src/components/organisms/Cart.svelte | 4 + src/components/organisms/Collage.svelte | 4 + src/components/organisms/Footer.svelte | 4 + .../organisms/InteractiveGlobe.svelte | 6 +- src/components/organisms/ListCTAs.svelte | 20 + src/components/organisms/Locations.svelte | 4 + .../organisms/NewsletterModule.svelte | 4 + src/components/organisms/PostersGrid.svelte | 4 + src/components/organisms/ShopHeader.svelte | 4 + src/components/organisms/ShopModule.svelte | 4 + .../[country]/[location]/[photo].svelte | 44 +- src/routes/[country]/[location]/index.svelte | 33 +- src/routes/__error.svelte | 9 +- src/routes/__layout.svelte | 3 +- src/routes/credits.svelte | 4 + src/routes/index.svelte | 55 +- src/routes/locations.svelte | 4 + src/routes/photos.svelte | 26 +- src/routes/shop/__layout.svelte | 4 + src/routes/subscribe.svelte | 4 + src/style/_animations.scss | 14 - src/style/_base.scss | 2 +- src/style/atoms/_box-cta.scss | 4 +- src/style/atoms/_button-cart.scss | 4 +- src/style/atoms/_button-circle.scss | 10 +- src/style/atoms/_button.scss | 10 +- src/style/atoms/_icon.scss | 8 - src/style/atoms/_scrolling-title.scss | 5 - src/style/atoms/_site-title.scss | 14 +- src/style/global.scss | 24 + src/style/imports.scss | 4 + src/style/layouts/_poster.scss | 73 +- src/style/modules/_globe.scss | 288 +++---- src/style/molecules/_cart-item.scss | 10 +- src/style/molecules/_heading.scss | 5 +- src/style/molecules/_house.scss | 40 +- src/style/molecules/_issue.scss | 2 +- src/style/molecules/_list-cta.scss | 14 - src/style/molecules/_location.scss | 59 +- src/style/molecules/_newsletter-form.scss | 13 +- src/style/molecules/_pagination.scss | 72 ++ src/style/molecules/_photo-card.scss | 28 +- src/style/molecules/_poster.scss | 6 +- src/style/molecules/_switcher.scss | 2 +- src/style/organisms/_carousel.scss | 4 +- src/style/organisms/_cart.scss | 31 +- src/style/organisms/_collage.scss | 15 +- src/style/organisms/_footer.scss | 19 +- src/style/organisms/_locations.scss | 3 +- src/style/organisms/_newsletter.scss | 22 +- .../{modules => organisms}/_postcard.scss | 8 +- src/style/organisms/_shop.scss | 20 +- src/style/pages/_credits.scss | 14 +- src/style/pages/_explore.scss | 54 +- src/style/pages/_homepage.scss | 88 ++- src/style/pages/_location.scss | 464 +++++------- src/style/pages/_photos.scss | 613 ++++++++------- src/style/pages/_shop.scss | 125 ++- src/style/pages/_subscribe.scss | 66 +- src/style/pages/_viewer.scss | 710 +++++++++--------- src/style/pages/shop/_intro.scss | 23 +- src/style/pages/shop/_posters.scss | 28 +- src/style/style.scss | 79 -- src/style/tools/_helpers.scss | 24 +- svelte.config.js | 22 +- 89 files changed, 1779 insertions(+), 1735 deletions(-) create mode 100644 src/components/molecules/Pagination.svelte create mode 100644 src/components/organisms/ListCTAs.svelte delete mode 100644 src/style/atoms/_icon.scss delete mode 100644 src/style/atoms/_scrolling-title.scss create mode 100644 src/style/global.scss create mode 100644 src/style/imports.scss delete mode 100644 src/style/molecules/_list-cta.scss create mode 100644 src/style/molecules/_pagination.scss rename src/style/{modules => organisms}/_postcard.scss (97%) delete mode 100644 src/style/style.scss diff --git a/src/components/atoms/Badge.svelte b/src/components/atoms/Badge.svelte index f774850..d12bf28 100644 --- a/src/components/atoms/Badge.svelte +++ b/src/components/atoms/Badge.svelte @@ -1,3 +1,7 @@ + + + + \ No newline at end of file diff --git a/src/components/molecules/PhotoCard.svelte b/src/components/molecules/PhotoCard.svelte index bd94fce..bad959d 100644 --- a/src/components/molecules/PhotoCard.svelte +++ b/src/components/molecules/PhotoCard.svelte @@ -1,3 +1,7 @@ + +