From 9a6ef694802fe03be6ebd2eb82996e052afdf944 Mon Sep 17 00:00:00 2001 From: AliReza Date: Thu, 15 Oct 2026 13:09:26 +0330 Subject: [PATCH] Justify multi-line prose app-wide (p, li, pre-line text); centered sections keep centering Co-Authored-By: Claude Sonnet 5.5 --- src/styles/index.css | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/styles/index.css b/src/styles/index.css index f8e5882..f9d5578 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -79,6 +79,24 @@ input, textarea { font: inherit; } + /* متنِ چندخطی (پاراگراف، گام‌های درس، متنِ سوال، حبابِ پی) دو‌طرف‌چین است تا لبه‌ی چپ + مرتب باشد. این‌ها در لایه‌ی base‌اند، پس هر جا کلاسِ text-center / text-left داده شده + برنده است و تیترها و برچسب‌های کوتاه سرِ جایشان می‌مانند. خطِ آخر طبقِ معمول راست‌چین + می‌ماند. text-justify فقط فاصله‌ی بینِ کلمه‌ها را باز می‌کند (کشیده‌نویسی در CSS نیست). */ + p, li, .whitespace-pre-line { + text-align: justify; + text-justify: inter-word; + /* از تک‌کلمه‌ی یتیم در خطِ آخر جلوگیری می‌کند */ + text-wrap: pretty; + } + /* پاراگرافِ داخلِ بخشِ وسط‌چین (حالتِ خالی، آنبوردینگ، اسپلش) وسط‌چین می‌ماند؛ + بدونِ این، قاعده‌ی بالا ارثِ text-center را می‌شکست. */ + .text-center :is(p, li, .whitespace-pre-line) { + text-align: center; + } + .text-left :is(p, li, .whitespace-pre-line) { + text-align: left; + } } @utility no-scrollbar {