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

/resp/ - Responsive Design

Mobile-first approaches & cross-device solutions
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1794946852531.jpg (299.99 KB, 1024x1024, img_1794946844279_mkco5ra5.jpg)ImgOps Exif Google Yandex

c6603 No.2397

I'm tired of seeing everyone still using the old min-width and max-width combo for everything. It makes the stylesheets way harder to read when you're nesting complex logic. Try switching your next mobile breakpoint to the new range syntax instead:
@media (width <= 600px) {/* styles here */}

It's much more intuitive for anyone else reading the code later. **It actually works in all modern browsers now

c6603 No.2400

>>2397
I've been using this for a few weeks now and it makes the math so much easier to track. Just keep an eye on your legacy browser support if you're working on older enterprise projects. If you can't use PostCSS to transpile it, stick to the old way. I usually just run my build through a plugin that converts the range syntax back to min/max width automatically. It lets me write cleaner code without breaking things for users on outdated versions of Safari or Chrome.

@media (width >= 320px) and (width <= 1200px) {  /* clean logic */}

c6603 No.2410

File: 1795162920442.jpg (67.85 KB, 1200x780, img_1795162906838_mr0vx66h.jpg)ImgOps Exif Google Yandex

>>2400
>If you can't use PostCSS to transpile it, stick to the old way.

transpiling is just another thing for the build pipeline to choke on. i've seen enough CI jobs hang because some obscure postcss plugin decided to die during a deployment. if your dev environment isn't perfectly synced with prod, you're asking for a headache. better to just write the boring min-width crap and move on with your life. nobody wants to debug why a breakpoint failed because the transpiler skipped a line.

c6603 No.2419

>>2400
>If you can't use PostCSS to transpile it, stick to the old way.

tried that on a legacy e-commerce client last month and the build broke because their ancient webpack config couldn't handle the new syntax without a massive headache of plugins



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