From b11bad188a34d9f6c2a270b0d7c48d8e9b38dc6a Mon Sep 17 00:00:00 2001 From: Alexander Alemayhu Date: Wed, 20 May 2026 15:46:10 +0200 Subject: [PATCH] fix: stop overriding template .card layout in gallery + editor preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last commit added `body > .card { display: flex; ... padding: 16px; text-align: center }` with specificity 0,1,1 — higher than templates' own `.card { display: flex; ... padding: 32px 24px }` (0,1,0). Result: every template that had its own centering lost it, and the 16px padding clipped large-text designs (Clean Basic right edge, Alex Deluxe wrapping into clipped second lines). Wrap the default layout rule in `:where(body > .card)` so the specificity drops to 0,0,0. Templates with their own `.card` rules win automatically. Templates without — Default, Only Notion, Raw Note, Minimal — still get flex-column centering as a fallback. Drop the padding entirely; the template owns padding. Hit on the live editor preview at /templates/edit/vocab-language (Vocab's `display: flex; align-items: center` was being stomped) as well as the gallery thumbnails. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/src/pages/TemplatesPage/renderNoteTypePreview.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web/src/pages/TemplatesPage/renderNoteTypePreview.ts b/web/src/pages/TemplatesPage/renderNoteTypePreview.ts index d6209e42f..918491daf 100644 --- a/web/src/pages/TemplatesPage/renderNoteTypePreview.ts +++ b/web/src/pages/TemplatesPage/renderNoteTypePreview.ts @@ -73,7 +73,7 @@ export function buildPreviewDocument( return `