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

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1789542978236.jpg (257.94 KB, 1024x1024, img_1789542970407_299qf34c.jpg)ImgOps Exif Google Yandex

c0ece No.2174

been working on this dashboard where the sidebar width changes based on some weird dynamic calc. instead of bloating my tailwind config with every possible pixel value, i've just been using the square bracket syntax directly in the template. it keeps the utility classes readable without jumping back and forth to the config file for a single tweak. works best when you have a specific calculation that doesn't repeat elsewhere.

grid-cols-[1fr_auto_minmax(200px,1fr)]gap-[calc(1rem+var(--dynamic-offset))]


it's clean slightly messy but much better than managing a massive config for one-off layouts. just make sure you don't forget the underscores instead of spaces inside the brackets or it'll break.

8bf39 No.2193

>>2174
just use a css variable for that gap instead of the long calc string because it makes debugging the computed styles way easier in devtools.



[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 ]