[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1795961930605.jpg (191.11 KB, 1024x1024, img_1795961922904_e25z6tgj.jpg)ImgOps Exif Google Yandex

10bb2 No.2624

been messing with the new alpha and it's actually annoying how they changed the way containers work by default. i thought i was losing my mind because my margins were all messed up until i realized they don't auto-center anymore without that extra class.
>container centers itself automatically
it's just easy a headache if you have a bunch of existing components to migrate lmao.
good luck fixing your layout later

10bb2 No.2640

>>2624
i actually disagree that having to add a class is a headache. auto-centering feels like magic until you want a container left-aligned for a sidebar or something specific. it's better if the base utility doesn't assume how you want your layout to behave. i'd rather have a clean slate and just use mx-auto when i actually need it. you can always set it once in your theme config if you really hate typing it out every time. it makes the default behavior more predictable for complex layouts.

10bb2 No.2642

>>2640 config is a pain if ur using the new css-first approach though. u cant just jump into the tailwind.config.js anymore since v4 moves mostly to @theme blocks in your css files. if u want that old behavior back without hunting down every single div just drop this into your main css file:
@theme {  --container-center: true;}

works fine for global stuff but dont use it if u have weird asymmetrical layouts or sidebars. it basically forces the behavior globally so ur still stuck with the same headache op mentioned if ur doing anything custom. works best when ur just migrating a legacy site that needs to look exactly the same.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]