kokoronis

little slime doing their best

31, white β˜… freelance illustrator β˜… jrpg enthusiast β˜… 90s anime β˜… soda-flavored slime

πŸ’πŸ’š: @birdrobot


lexyeevee
@lexyeevee
  1. 1

    text stuff mostly
  2. 2

    boxes, transform
  3. 3

    positioning, clicking stuff
  4. 4

    flexbox and grid
    🌟 your here 🌟
  5. 5

    animation and other nonsense
Are YOU a CSS BABY who just wants to know how to put stuff in a row already?
fox
eevee's web zone β€” Mozilla Firefox
βˆ’
Γ—
← β†’ ⟳a> β―ƒ
πŸ”’ https://eev.ee/
Are your friends
making entire freaking websites in their posts, and leaving you feeling left out?
hey guys! finally finished the new layout, hope you enjoy!
Β© 1997 twilight sparkle
THIS IS A HENTAI FREE ZONE
Done

Are you holding out for A hero by the end of the night
She's gotta be <strong> and she's gotta be <em>
?

I have excellent news. Your patience has been rewarded. We have finally, finally arrived at

thegoodstuff

lexyeevee
@lexyeevee

good news (?): i felt like the grid stuff got kind of rushed at the end, so i went back and expanded some of those last-second bullet points into actual prose. now span and alignment get some real treatment, and auto-flow gets a real introduction with an explicit comparison to flexbox.

tragically i deleted the hazard diamond along the way, so, here it is for posterity. also i guess now i don't mention aspect-ratio anywhere. crap i better edit it again

here's a hazard diamond i guess

2
2
COR
2

You must log in to comment.

in reply to @lexyeevee's post:

No. You can never use it. Would you like to use WebUSB instead. We made a laptop that only runs a browser and we're going to fuck the whole web up instead of admitting that was maybe a dumb idea

Hey. I sometimes work on writing the code in browsers that powers all of this CSS stuff. And while I haven't worked on grid, my understanding (and hearing from folks who know more about this) is that Firefox took shortcuts when implementing grid that make it simpler than the spec says, and implementing subgrid there was easier. Whereas Chrome didn't take those shortcuts, and making subgrid work was very complicated.

It's not a property – IIRC you can have a circular dependency between sizes, and in those cases the spec says the layout should be run in two passes, and Firefox does only one. And now that I look at the spec, this might be something specific to subgrid, rather than general to grid, so Chrome might have wanted to get it right when implementing it for the first time.

Chrome has also spent the last ~6 years slowly rewriting their layout engine (https://developer.chrome.com/articles/layoutng/), to make things like multi-pass layout not have to choose between slowness and bug-proneness. And I suspect they wanted to have the new layout system well in place before starting work on subgrid.

i thought i had a decentish knowledge of grid and flex, but this is what i wrote when i wanted the children of an element to all be equal width hours ago:

display: "grid",
gridTemplateColumns: `repeat(${number_of_children_easily_calculated}, 1fr)`,

which is bad (especially compared to display: flex and then flex: 1 on the children), but what's even worse is that my go-to before was to precalculate the widths in percentages. this is lame and bloats the css for no reason, but it works. except for the occasional one pixel gaps which (and i can't find where i did this?) i've fixed with outlines in the past which is just really eugh

anyway thank you so much for this post

thinking about it made it a lot clearer in my mind how grid and flexbox have control at opposite levels (sort of), which i think that emphasizes well. idk i've spent like half an hour on the last sentence, so grain of salt etc etc

I'm crying salty tears because this post is an incredible resource, and I can't use more than half of it because I'm stuck in the bullshit environment of "doing web for games UI" called Coherent Gameface (yes, that's really what it's called), which is a browser of sorts that has:

  • No display: grid πŸ˜₯
  • Yes display: flex! πŸ˜„
  • No support for gap of any kind 😨
  • minmax()? Buddy, we don't even support calc() if you try to combine % and px!

I have to cobble together solutions from Twitter Bootstrap circa 2013 and blogposts from before the grid era and it suuuucks. So thank you for the random asides in your post, because they actually help a lot!!

You're right. I messed up in that example. But let's say --font-size is 1.2em, and you try to get 50% of that variable with calc(), that's definitely a scolding and a finger-wagging from Coherent Gameface.

You're right again, I was thinking of addition. At the risk of "posting through it," here's what the documentation says:

CSS calc() support
Not supported within @keyframe definitions
Mixing β€œ%” and other dimensional units is not supported (e.g. 50% - 20px)

You should scroll down that page if you want to see some absolute insanity, by the way.

Excellent excellent post Eevee, this rules.

Really nothing to comment about in the main post, you did great. At the very end:

  • As Andreu said on another comment, the existing subgrid impls aren't correct (in cases involving intrinsic sizes) and the test suite didn't cover nearly enough interesting cases. We're doing it correctly, and part of that involved waiting for the refactor of our entire layout engine to be finished. (Also the layout team is different people than whatever other specs your complaining about. Talking about the merits of those other specs isn't useful in this post's comments tho, so I won't.)
  • Masonry is exciting in theory but we're pretty sure it's wrong to actually build it on top of Grid. Ian has an alternate proposal we just recently put forth for the WG. It'll still look pretty Grid-ish, tho.

i couldn't find anything specifically wrong with gecko's subgrid impl; it currently doesn't do a second pass on grid sizing, but that's not subgrid specific. (also i had to check the spec to work out a case where it failed, and i found some hints that fixing it might be a priority for this year.)

no shade on people doing layout work. but absolutely shade on google as an organism for having all kinds of ulterior motives and very little to dissuade it from pursuing them.

ok yeah just the ideas bandied around in the OP here make it sound like cramming masonry into grid is a clumsy hack. which i guess it is

fun fact: in looking through bugzilla earlier, i found someone requesting that the track count limit be raised... because they were faking masonry by spanning 1px rows, and only 1000 of those doesn't get you very far apparently

I'm trying to make side-by-side flex boxes with one box being a thumbnail of an image and the other being a text box, but no matter what I try there's a big awkward gap above the image.

<div style="display: flex; height: 12em; gap: 0.5em;">
  <div style="flex: auto; padding: 0.5em; align-items: top;"><a target="_blank" href="https://i.imgur.com/bGaosRT.png">
  <img src="https://i.imgur.com/bGaosRT.png" alt="Cain Juntley" style="width:200px">
</a>
</div>
  <div style="background: hsl(90, 60%, 70%); flex: auto; padding: 0.5em;"><b>Cain Juntley (Deceased)</b><br>A space adventurer who chose to come to Earth to fight ADVENT. May the knowledge there is non-hostile life out there be remembered.<br>
<i>Dan's fun facts: Cain Juntley was submitted by my friend Patrick AKA Shadowsandbag. He is from a tabletop RPG oneshot.</i></div>
</div>
<br>
<div style="display: flex; height: 8em; gap: 0.5em;">
  <div style="flex: auto; padding: 0.5em;"><a target="_blank" href="https://i.imgur.com/3vhw8w0.png">
  <img src="https://i.imgur.com/3vhw8w0.png" alt="Dennis 'Thin Man' Notanalien" style="width:200px">
</a></div>
  <div style="background: hsl(40, 60%, 70%); flex: auto; padding: 0.5em;"><b>Dennis "Thin Man" Notanalien</b><br>
Dennis is a normal human from a normal human city in the country of France and is NOT a "thin man" in disguise. That is all.</div>
</div>

Additionally, here is an attempt to make a 4-image grid.

<div style="display: grid; grid-template-columns: auto auto; margin: 0px auto;">
  <div style="padding: 5px;">
    <img src="https://i.imgur.com/qPuaazI.jpeg" alt="A sectoid using mind control">
  </div>
  <div style="padding: 5px;">
    <img src="https://i.imgur.com/usEaIIq.jpeg" alt="The Wanderer getting mind controlled.">
  </div>
  <div style="padding: 5px;">
    <img src="https://i.imgur.com/3JOwzta.jpeg" alt="The Wanderer shooting Cain Juntley.">
  </div>  
  <div style="padding: 5px;">
    <img src="https://i.imgur.com/3uJi7NR.jpeg" alt="Cain Juntley's dead body getting knocked to the ground by gunfire. He disturbs the foliage and lands on the body of an ADVENT troop.">
  </div>
</div>

Big awkward image gaps have been endlessly confounding in my attempts to display images.

in reply to @lexyeevee's post: