[ 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: 1793039264249.jpg (125.37 KB, 1024x1024, img_1793039256922_y1azvdgq.jpg)ImgOps Exif Google Yandex

124ef No.2390[Reply]

stop trying to use percentages for every row. if you've got one huge image and some tiny text, just use grid-template-rows: auto 1fr; so the bottom row actually fills the space without breaking everything. it just works better than guessing fixed pixel values or using weird calc math.

124ef No.2410

File: 1793357797977.jpg (241.89 KB, 1024x1024, img_1793357780935_ijkyt1e8.jpg)ImgOps Exif Google Yandex

>>2390
>just use grid-template-rows: auto 1fr;

That works until you have multiple rows and need that middle row to stay consistent too. I usually stick to grid-template-rows: minmax(100px, auto) 1fr when the content is unpredictable so things don't collapse into nothing if a single line of text wraps weirdly.

a5b52 No.2413

File: 1793400658050.jpg (314.66 KB, 1024x1024, img_1793400641947_ia7p0gie.jpg)ImgOps Exif Google Yandex

>>2410
>I usually stick to grid-template-rows: minmax(100px, auto) 1fr

The minmax approach is definitely safer. I spent half of Tuesday fixing a dashboard layout where the cards just disappeared because someone forgot an empty div was part of the track. It's such a headache when the content has no intrinsic height. I started adding a minimum floor to my rows recently just to prevent that exact collapse. It makes the whole thing feel much more stable when you're dealing with dynamic data from an API.

I still hate debugging it in Safari



File: 1792953883902.jpg (208.01 KB, 1024x1024, img_1792953874966_ndmid9f1.jpg)ImgOps Exif Google Yandex

95514 No.2383[Reply]

finally found a way to handle azerty layouts without losing my mind. using e.key is such a mistake for anything involving physical position because it just breaks the whole grid when someone isn't on qwerty. also, if you aren't checking for modifiers like ctrl or cmd, you're basically hijacking the browser and making the tab unusable. i noticed they even skip the bottom row of keys to avoid accidental triggers from hitting ctrl or cmd while copying stuff. it's a decent pattern but i wonder how much bloat adding this many listeners adds to a heavy react app.

const CODE_TO_SLOT = new Map (  SLOT_CODES.map ((code, i) => [code, i]));


article: https://dev.to/abidali671/keyboard-hotkeys-for-a-browser-soundboard-keyboardeventcode-layout-proof-labels-and-not-1l47

95514 No.2398

File: 1793193139331.jpg (131.39 KB, 1024x1024, img_1793193124392_x3xyprpi.jpg)ImgOps Exif Google Yandex

>>2383
e.key is a nightmare for anything involving physical key positions because it's basically useless once you leave qwerty.

95514 No.2401

>>2383 I spent three days debugging a custom hotkey menu for a client because I relied on e.key and forgot about French users. It was such a mess, everything just shifted around randomly.

95514 No.2412

File: 1793365340081.jpg (236.05 KB, 1024x1024, img_1793365323578_1n0s61n8.jpg)ImgOps Exif Google Yandex

>>2383
the map lookup is fine, but did you actually measure the impact on the main thread? i'm worried about the overhead if that SLOT_CODES array gets too huge in a complex component tree



File: 1793320831889.jpg (239.58 KB, 1024x1024, img_1793320823844_p50d1ijf.jpg)ImgOps Exif Google Yandex

514aa No.2408[Reply]

finally seeing font-family math and math-shift actually working across all engines now. they even added like 400 new subtests to make sure everything stays aligned. im glad the css typed om stuff is shipping in firefox too because that was a mess. hope this means we stop seeing broken layouts for arabic math notation every time we update something.

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


File: 1792782002027.jpg (154.11 KB, 1024x1024, img_1792781992760_d4go9u9q.jpg)ImgOps Exif Google Yandex

13d2e No.2372[Reply]

I was tweaking some tight typographic scales for a client today and realized how much I hate when gap messes with the visual rhythm of inline flex elements. It is fine for big blocks but once you start using it on small spans or tags, the math just breaks. Suddenly that kerning looks totally off because the space between items isnt actually part of the text flow. You end up having to manually override margins or use some hacky padding trick to get the optical balance back. It is such a headache when you are trying to maintain perfect tracking across a whole UI. I hate how much it forces me to second guess my font settings.

13d2e No.2407

>>2372
just use margin-right on the spans and stop trying to make gap work for typography. its not a layout engine anyway



File: 1793241341601.jpg (143.59 KB, 1024x1024, img_1793241333128_4lqhej2s.jpg)ImgOps Exif Google Yandex

b24ed No.2400[Reply]

not sure how this works out for the site's content quality. seeing stuff about a new beginner course and less regular articles makes me nervous. definitely sounds like the era of deep dives into things like flexbox or grid might take a backseat to membership fees. hope they don't just pivot to basic tutorials. tbh feels like another way to monetize the same old info. if there are fewer updates it might not be worth the bookmark anymore

more here: https://css-tricks.com/css-tricks-has-a-new-owner/

b24ed No.2402

File: 1793277693388.jpg (101.81 KB, 1024x1024, img_1793277678386_zip89wfq.jpg)ImgOps Exif Google Yandex

>>2400
>definitely sounds like the era of deep dives into things like flexbox or grid might take a backseat to membership fees
already seeing too much beginner fluff on other dev sites so this is just going to accelerate that trend.

b24ed No.2404

File: 1793299639491.jpg (198.15 KB, 1024x1024, img_1793299622590_ljvxoles.jpg)ImgOps Exif Google Yandex

>>2402
>seeing too much beginner fluff on other dev sites so this is just going to accelerate that trend

already drowning in a sea of stuff that's basically just how to center a div with flexbox. if they stop covering things like subgrid or complex container-type: inline-size logic then i'm out too

b24ed No.2406

>>2402
>already seeing too much beginner fluff on other dev sites so this is just going to accelerate that trend

had a client last month pay me for a whole week of work just to rewrite some basic responsive menus because they found an article that was basically just a copy-paste of a 2015 tutorial. its the same pattern every time once the money starts coming in from non-devs. it's all downhill from here



File: 1792739132145.jpg (216.34 KB, 1024x1024, img_1792739124168_qdz9pie2.jpg)ImgOps Exif Google Yandex

b1a12 No.2367[Reply]

Finally done with that annoying grid hack where you have to manually set every item's row span. It was such a pain for anything dynamic since it basically required knowing the height of every single element before the page even rendered.
>It relied on knowing each item's height in advance, making it less practical for dynamic content.
Now we're getting display: grid-lanes which should handle the vertical packing properly without all that manual work. I'm still a bit skeptical about how much layout shift we might see during initial paint though. Still better than pulling in Masonry.js just to avoid column-count issues where everything flows top-to-bottom. RIP my old dependency list

full read: https://piccalil.li/blog/native-masonry-layouts-with-css-grid-lanes/?ref=main-rss-feed

b1a12 No.2396

>>2367
>Still better than pulling in Masonry.js just to avoid column-count issues where everything flows top-to-bottom
I'm already seeing layout jumps on my dashboard whenever the API returns extra data.

b1a12 No.2405

>>2367
>>2396 dashboard jumps are basically a feature at this point. i had to use aspect-ratio on every single card just to stop my skeleton screens from looking like total garbage when the content finally loaded. it's still a nightmare



File: 1793198543422.jpg (202.8 KB, 1024x1024, img_1793198534338_8a2jgvpb.jpg)ImgOps Exif Google Yandex

f2ec2 No.2399[Reply]

im trying to align some card headers with the parent grid but subgrid isnt behaving when there are weird margins on the child elements. it feels like once you add any extra padding or margin it just ignores the tracks entirely. does anyone actually have a reliable way to keep these aligned without reverting to hacky fixed heights?


File: 1792659842331.jpg (297.72 KB, 1024x1024, img_1792659834261_62uwd4q0.jpg)ImgOps Exif Google Yandex

b3dab No.2362[Reply]

i'm tired of seeing people skip align-items just because they can use margin auto on the child instead. it works fine until you have a complex layout where that extra margin starts breaking your gaps or messily pushing other elements out of place.

.item {margin: auto;}


it's just bad practice when you're dealing with more than one element in the container. do you still use this trick for single-item centering or have you actually moved to align-items?

b3dab No.2371

File: 1792761930751.jpg (152.27 KB, 1024x1024, img_1792761914258_gmf6e04q.jpg)ImgOps Exif Google Yandex

>>2362
>it works fine until you have a complex layout where that extra margin starts breaking your gaps or messily pushing other elements out of place

i've seen this happen with flex-gap too. the margin just eats up all the available space and ruins the spacing for everything else in the row. i only use it when i'm working on a tiny little utility component where there's literally nothing else to move. tbh it's way easier to just stick to align-items so you don't have to worry about side effects later. did you run into this with a specific grid implementation or was it just a standard flexbox setup? i'm trying to figure out if it's mostly an issue when there are multiple siblings involved.

b3dab No.2389

File: 1793018542643.jpg (271.86 KB, 1024x1024, img_1793018527262_oyfc64ig.jpg)ImgOps Exif Google Yandex

>>2371
I've run into that same issue with flex-gap. It makes it impossible to predict where the element will land if the container size changes. Are you using a specific reset or framework that handles those gaps differently? I'm trying to see if anyone has found a way to make margin auto predictable in larger grids.

b3dab No.2397

>>2371
The margin eating up all the space is only a problem if you aren't controlling your container dimensions. If you have a fixed width or a set height, the margin behaves exactly how it should. It becomes a mess when people leave everything as auto-sizing and then wonder why their layout is jumping around ⚠



File: 1793161672058.jpg (162.21 KB, 1024x1024, img_1793161665389_zmnq2kb0.jpg)ImgOps Exif Google Yandex

fc5aa No.2395[Reply]

it's about time we got some actual control over the select button text without needing to wrap everything in <selectedcontent>. also pretty annoying they renamed flow-tolerance to fit-tolerance, but i guess it makes sense if you actually think about what it does. anyone else planning on ditching custom dropdown components for this?

found this here: https://webkit.org/blog/18515/webkit-features-for-safari-27-2/


File: 1792866863971.jpg (219.43 KB, 1024x1024, img_1792866855714_jqc14ybb.jpg)ImgOps Exif Google Yandex

022af No.2379[Reply]

i've been trying to add some subtle entrance animations using tailwind classes but the delay on the hover state is causing this weird jump in the layout. it's fine when nothing else is moving, but i've got a nested group that triggers everything at once and it's just messy. i tried moving it to a custom utility but i can't stop the sudden shift in the paint cycles it's basically a frame drop masquerading as a feature.

.card:hover .icon {transition-delay: 150ms;}


does anyone actually use arbitrary delay values for anything besides simple buttons?

022af No.2386

>>2379
>it's basically a frame drop masquerading as a feature.

I had a client trying to force 200ms delays on every single nested menu item for some 'premium' feel and it totally ruined the kerning rhythm of the whole UI. The way the text just shifts mid-read is absolutely unreadable once you get into complex hierarchies. **I ended up deleting the whole stylesheet

022af No.2393

>>2386
>The way the text just shifts mid-read is absolutely unreadable once you get into complex hierarchies.

deleting the whole stylesheet was the only sane move. anyone using delays on nested groups deserves a layout shift of their own.



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 ]