From d52e62fe7db674ce24ab28d46c8af645e6e8f55a Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Tue, 25 Aug 2026 16:29:25 +0200 Subject: [PATCH] temp: adatta il sito sia per telefoni (schwermi verticaluiu piccoli) che per tablet che per desktop --- frontend/app/assets/css/main.css | 51 +++++++++++--- frontend/app/components/ArticleCard.vue | 13 ++-- frontend/app/components/LanguageSwitcher.vue | 13 +++- frontend/app/layouts/default.vue | 70 +++++++++++++++++--- frontend/app/pages/blog/[slug].vue | 8 ++- frontend/app/pages/index.vue | 25 ++++--- 6 files changed, 141 insertions(+), 39 deletions(-) diff --git a/frontend/app/assets/css/main.css b/frontend/app/assets/css/main.css index 1f25fba..5eec6b2 100644 --- a/frontend/app/assets/css/main.css +++ b/frontend/app/assets/css/main.css @@ -13,8 +13,18 @@ --width: 76rem; --width-prose: 40rem; - --space: 1.5rem; --radius: 2px; + + /* Breakpoints used throughout: 48rem = tablet, 64rem = desktop. */ + --space: 1.1rem; + --gap-section: 2.5rem; +} + +@media (min-width: 48rem) { + :root { + --space: 1.5rem; + --gap-section: 4rem; + } } *, @@ -99,7 +109,7 @@ h3 { display: flex; align-items: center; gap: 1.25rem; - margin-block: 4rem 2rem; + margin-block: var(--gap-section) 1.75rem; } .section-heading::after { @@ -111,8 +121,8 @@ h3 { /* Centred title block at the top of a listing page. */ .page-header { - margin-bottom: 3.5rem; - padding-bottom: 2rem; + margin-bottom: var(--gap-section); + padding-bottom: 1.75rem; text-align: center; border-bottom: 1px solid var(--color-border); } @@ -127,17 +137,40 @@ h3 { .card-grid { display: grid; - gap: 3rem 2.5rem; - grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); + gap: 2.25rem 1.5rem; + /* One column on phones, two on tablets, three or more on wide screens. */ + grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); padding: 0; margin: 0; list-style: none; } +@media (min-width: 48rem) { + .card-grid { + gap: 3rem 2.5rem; + } +} + /* Article body */ .prose { max-width: var(--width-prose); - font-size: 1.075rem; + font-size: 1.0125rem; + /* Editors paste long URLs; without this they push the page sideways. */ + overflow-wrap: break-word; +} + +@media (min-width: 48rem) { + .prose { + font-size: 1.075rem; + } +} + +/* Markdown tables have no wrapper to scroll, so the table scrolls itself. */ +.prose table { + display: block; + max-width: 100%; + overflow-x: auto; + border-collapse: collapse; } .prose h2, @@ -193,10 +226,10 @@ h3 { .pagination { display: flex; flex-wrap: wrap; - gap: 2rem; + gap: 1rem 2rem; align-items: center; justify-content: center; - margin-top: 4rem; + margin-top: var(--gap-section); padding-top: 2rem; border-top: 1px solid var(--color-border); font-size: 0.85rem; diff --git a/frontend/app/components/ArticleCard.vue b/frontend/app/components/ArticleCard.vue index 72f8311..be935b7 100644 --- a/frontend/app/components/ArticleCard.vue +++ b/frontend/app/components/ArticleCard.vue @@ -10,14 +10,16 @@ const cover = computed(() => mediaUrl(props.article.cover))