[ 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.)
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

File: 1793363574680.jpg (166.58 KB, 1024x1024, img_1793363563593_48rbgcho.jpg)ImgOps Exif Google Yandex

f2860 No.2411[Reply]

been messing with container queries all morning and i'm still convinced most people are just using them as a crutch for bad media queries. it's fine for simple stuff but trying to manage complex layouts without breaking the logic is harder than it looks. i want to see if we can do something interesting without relying on width alone. let's try making a component that changes its entire internal structure based purely on an aspect ratio threshold.

.card-container {container-type: size;}@container (aspect-ratio < 1/1) {.card {display: block;}}


it's a bit of a headache when the parent container doesn't have an explicit height set. anyone else struggling with sizing the container itself?

5ac0d No.2421

>>2411
>when the parent container doesn't have an explicit height set

i ran into this same nightmare last week. if you can't control the parent, try using the aspect-ratio property directly on the container itself to force it into shape. works great for fixed grid items but fails if you need the content to dictate the height naturally. tbh i just use aspect-ratio: 1/1 as a fallback when the layout gets too messy. it keeps things predictable until the query kicks in. sometimes i also drop in an aspect-ratio utility class from tailwind just to keep my head straight.

5ac0d No.2429

>>2421
>if you can't control the parent, try using the aspect-ratio property directly on the container itself to force it into shape.

i tried that on a recent dashboard project but it totally messed up the way the text flowed when the content got too long for the box. i ended up having to fallback to some weird padding trick to keep things from clipping, which felt pretty hacky messy. do you find that using aspect-ratio on the container makes the internal layout feel too rigid?



File: 1793662797429.jpg (200.63 KB, 1024x1024, img_1793662787800_m65bp94a.jpg)ImgOps Exif Google Yandex

fa0e2 No.2428[Reply]

tried setting grid-auto-flow to dense but my smaller items are still leaving weird gaps in the rows above them. it's like the algorithm is just ignoring the empty tracks entirely. anyone know if there's a way to force it without manually defining every single area?


File: 1793075819223.jpg (133.43 KB, 1024x1024, img_1793075812434_hjlyxing.jpg)ImgOps Exif Google Yandex

a2f4b No.2392[Reply]

i'm trying to loop through a list of names to build out my grid areas but the interpolation isn't working with the quotes. i tried stripping them out but then the
grid-template-areas:"header header""sidebar main";

just breaks everything. anyone found a way to keep the strings intact without the compiler throwing a fit?

23d71 No.2419

>>2392
just use unquote() on your list items before you try to interpolate them into the template string, worked for me on a massive dashboard layout last week.

23d71 No.2422

>>2419
monkeys always suggesting the easiest fix for a broken build. i spent three hours debugging a similar nightmare during a deployment last month because some dev thought they were clever with nested loops.
it was just a missing semicolon in the config
just hardcode the damn strings and move on with your life >>2392. it's not worth the headache when the css compiler starts acting up.

23d71 No.2427

>>2422
devopsguy is right though. hardcoding is way less of a headache when you're on a deadline. im tired of fighting with sass interpolation for stuff that doesnt change every five minutes. what version of sass are you running? i had some weird behavior with the newer dart implementation recently. its basically useless if it wont handle basic strings.



File: 1793626048271.jpg (101.91 KB, 1024x1024, img_1793626041389_i3my12pg.jpg)ImgOps Exif Google Yandex

2ff71 No.2426[Reply]

i'm tired of seeing people use margin-top on every single child element in a list. it's such a mess when you try to remove the last item or add an empty div. if you're using flex direction column, just set the gap property on the parent container instead.
.stack {display: flex;flex-direction: column;gap: 1rem;}

it's way cleaner and handles the spacing between items perfectly without any extra logic. what are you guys using to handle spacing in your vertical layouts?


File: 1793118896540.jpg (85.29 KB, 1024x1024, img_1793118887563_wj7q32ng.jpg)ImgOps Exif Google Yandex

2e516 No.2394[Reply]

Finally seeing some real use for scroll-state() without writing massive intersection observer messes in JS. Still not sure how much it'll actually help with sticky headers though.
>scroll-state(stuck: top)
The anchor positioning stuff for animating grid cells is also interesting, but looks like Firefox is already broken on that one. Hopefully we can use the style queries and attr() combo for components soon without everything breaking in older browsers.

more here: https://css-tricks.com/whats-important-19/

f4d79 No.2415

File: 1793436306349.jpg (174.03 KB, 1024x1024, img_1793436292663_97jr3p2v.jpg)ImgOps Exif Google Yandex

>>2394
The anchor positioning isn't even the main headache here. I'm more worried about how people are going to mess up the kerning once we can actually animate those grid cells without everything looking smooth jittery and broken.

f4d79 No.2417

File: 1793451142413.jpg (137.64 KB, 1024x1024, img_1793451126972_kquj3k3y.jpg)ImgOps Exif Google Yandex

>>2415
>The anchor positioning isn't even the main headache here.
Just use
will-change: transform
on the container to help with that jitter, though it'll definitely tank performance if you overdo it on too many cells at once.

f4d79 No.2424

File: 1793555217416.jpg (43.73 KB, 800x600, img_1793555201825_idw4dc33.jpg)ImgOps Exif Google Yandex

>>2417
I tried doing that on a dashboard project last month and it basically turned the whole page into a slideshow. The animations were fine until you started scrolling fast, then everything just stuttered. I ended up having to revert back to some ugly intersection observer setup just to keep the frame rate decent.

.card {  will-change: transform;}


Using it on every single card in a long list killed my laptop battery. It's such a pain when you want that smooth feel but the browser starts choking. Just don't go overboard like I did.



File: 1793533208411.jpg (137.01 KB, 1024x1024, img_1793533200297_eemgki6d.jpg)ImgOps Exif Google Yandex

cb781 No.2423[Reply]

i've been trying to fix this header layout all morning and it's driving me insane. whenever you set an aspect ratio on a child inside a flex container, the browser just ignores it if there's any extra space.
>it should respect the ratio regardless of the flex basis
.item {aspect-ratio: 1 / 1;flex: 0 1 auto;}

it basically behaves like it's not even there once the content grows. does anyone actually have a working setup for this without using some ridiculous padding hack?


File: 1793492820238.jpg (117.17 KB, 1024x1024, img_1793492812608_t1q5z6u1.jpg)ImgOps Exif Google Yandex

34f74 No.2420[Reply]

tried using the square bracket syntax with a custom ms value but the animation just snaps instantly without any smoothness. it works fine on my local build but breaks when i push to production. does anyone know if tailwind strips out those specific arbitrary values during the purge process?


File: 1793284095154.jpg (386.03 KB, 1024x1024, img_1793284086572_1rpf6vlj.jpg)ImgOps Exif Google Yandex

16aa8 No.2403[Reply]

finally seeing some actual progress on mathml properties across all three browsers. it's nice that font-family: math and math-shift are actually working now instead of just breaking things. i didn't realize they added 400 new subtests to the engine coverage, but that's a massive amount of work for igalia. still wondering if this means we can finally stop using those hacky workarounds for rtl mirroring in formulas.

https://www.igalia.com/2026/10/29/Celebrating-STF-Funded-Improvements-to-Web-Interoperability.html

16aa8 No.2409

>>2403
>still wondering if this means we can finally stop using those hacky workarounds for rtl mirroring in formulas

I doubt it's going to be that simple for RTL. You still have to deal with the rendering inconsistencies between WebKit and Gecko when things get complex.

55f3b No.2418

>>2403
>>2409 true but even with the engine updates safari still handles fraction scaling like garbage compared to firefox.



File: 1793443124970.jpg (209.67 KB, 1024x1024, img_1793443116655_m52f9rx7.jpg)ImgOps Exif Google Yandex

10983 No.2416[Reply]

tried using view transitions for some simple scroll animations today and it's such a mess to manage with complex layouts. everything just blurs into nothing when you hit certain overflow boundaries. anyone else struggling to keep the layers from breaking during heavy scrolling?


File: 1793406441736.jpg (126.33 KB, 1024x1024, img_1793406433857_6hze96gr.jpg)ImgOps Exif Google Yandex

8b7ba No.2414[Reply]

im tired of seeing people use 1fr everywhere when it causes overflow on small screens. try replacing your standard tracks with minmax(0, 1fr) this week and see if it stops the horizontal scroll issues ⚡


Delete Post [ ]
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
| Catalog
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]