#dev 2026-11-13

2026-11-13 UTC
sknebel, troojg, levatography[d], parnikkapore_x, Xe, rnkn, benji, [social], eb, lanodan, oxtyped, Saige_Leah, girlonthemoon, ttybitnik, grufwub, stewalec, Elleo, sp1ff, [artlung], strugee, [tantek], JoshuaMorris, ruecharli, Kaja, Ace, GWG, sivoais, jjuran and dabeglavins joined the channel
#
aaronpk
ok the iOS on-device AI models are pretty cool
#
aaronpk
i made a photo picker in my new Teacup app that filters my camera roll to show me only photos of food
barnaby, [KevinMarks], calciume, k3can81, nermut, ancarda, JoshuaMorris, sandra, Salt, wturrell, Tiffany, mossymaker, MD87, bargaintreeflow, jeremycherfas, stefen, hypha_, chimo, trwnh, chrisburnell, pfych, vikanezrimaya, TwinAdam, redshuffle, valis2030, bb010g, cobbland, jone42, owls and [Leo] joined the channel
#
WinnerWind
has anyone tried making an interactive, one image at a time gallery using JUST css? i found this https://www.w3schools.com/css/css_image_gallery.asp which is close but not quite what I am trying to do
rossabaker, voxpelli, ax562 and vriska joined the channel
#
[Murray]
Depends exactly what you mean, the W3S doesn’t seem to be an interactive gallery, more a lightbox system. I’ve built those using the `<button command="show-modal" commandfor="…">` wrapped around images, and then a `<dialog>` element which has the `id` in the `commandfor`. That gives you a lightbox with zero JS, I believe fully accessible, though I haven’t done a deep audit
#
[Murray]
I have an example in a POC WIP project I have, but I don’t want to share a link here because it will get logged, and that site is purposefully hidden from search engines. Will post in #indieweb-cafe
#
WinnerWind
[Murray]: saw the link! i guess this is the best we can do with CSS and without weird ID tricks id rather not do
#
WinnerWind
so ill try doing that
#
[Murray]
I still use JS with that (you will need to disable JS locally to see just the CSS functionality) as I wanted an actual _gallery_, with the lightbox allowing you to navigate between pages
#
[Murray]
As always, CSS-only can do some of those things, but not in an accessible way. That’s about as far as I’ve been able to push it
[Murray] joined the channel
#
WinnerWind
[Murray]: using ols and lis was smart!
#
[tantek]
Hmm if I were to try to build this with HTML+CSS and no JS, I'd experiment with hyperlinks to fragments and :target
#
[tantek]
That should be doable accessibly as well
#
[Murray]
Not sure how you’d architect a lightbox using a fragment?
#
[Murray]
I’ll admit, I haven’t explored fragment links much, because I find them very jarring when I click one 😅
#
[tantek]
That's where the :target selector comes in handy
#
[tantek]
That plus :has should be sufficient to style a dynamic light box view based purely on clicks on links
#
[tantek]
See MDN entries for those two selectors
#
[Murray]
So you would link an image to itself, then when targeted, change the style of the image to pop it out and overlay it? I’m not sure how you’d handle light dismiss, scroll management, or anything else that the dialog element gives you, but I think I can see how you would give it the aesthetic of a lightbox that way
#
[Murray]
provided that takes you back to the gallery page
#
[Murray]
I will say, I do feel like this kind of gallery pattern is a really good option for “just make it a new page”. So you have one page that’s the gallery, and a bunch of pages that are each “lightbox” image, and when you click a gallery image it just links to the lightbox page. That requires zero JS, you can do prev/next navigation fairly easily, the only thing you lose is native light dismiss, but a close “button” can s
#
[Murray]
And with a tiny amount of JS, you could also add dismiss patterns to take you back to the gallery page
bterry, neatnik and rrix joined the channel
#
WinnerWind
ended up using a flex row instead of a grid because i couldnt get the grid working https://x0.at/1dO6oOOG1n.png
#
[Murray]
I think flex is a totally reasonable option here, but out of interest, what was the problem with the grid?
#
WinnerWind
[Murray]: i honestly have no idea how to use the grid, it kept putting them on vertically
#
[Murray]
At a guess, I’d say you maybe didn’t have a column layout defined in that case. Unless you specify otherwise, Grid will assume “auto columns, auto rows”, which works the way people want for rows, but for a column it’s basically just renders one
#
[Murray]
So you can do something like: `grid-template-columns: 1fr 1fr` to create a 2-column layout, or `grid-template-columns: repeat(4, 1fr)` for a 4-column layout
roxwize joined the channel
#
WinnerWind
ah, the thing is that i wanted it to fill up as many rows as it could, and then start a new row when its out of space
#
WinnerWind
flex with row wrap does that
#
[Murray]
(you can make these as complex as you like, mix fixed widths with flexible units like `fr`, set `minmax()` values, its a lot)
#
[Murray]
Do you mean fill up as many columns, and then wrap?
#
WinnerWind
oh, yes, my bad
#
[Murray]
Yeah, in that case you have to _specify_ the column sizes, otherwise the first column will just be massive. I think something like `grid-auto-columns: min-content` can work, but I honestly find that more messy. Unless you really need control over both axes (horizontal and vertical), or you need things aligned, flex is just simpler
#
[Murray]
The standard approach fyi is `grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))`. Not the simplest to grok, but basically that says “repeat columns that either fit the content or at minimum 250px wide, until you run out of space, then wrap”
#
[Murray]
If you haven’t seen it before, CSS Tricks remains the go-to grid explainer imo: https://css-tricks.com/complete-guide-css-grid-layout/
#
[Murray]
(oh and hopefully clear, but `250px` can be any minimum value, including responsive units, that’s just the example CSS Tricks uses 😉 )
#
WinnerWind
oh wow, that's a lot
#
[Murray]
It took me a while to get grid, though I think because I started web dev with table-based layouts it came a little easier 😅 still have to look up the `auto-fit` and `auto-fill` syntax almost every time though
#
WinnerWind
ig ot it working with a grid!
#
WinnerWind
not perfect but it works
#
[Murray]
interesting unit choice! just checking, but `20vh` will define the _width_ of the column by the _height_ of the viewport. Kind of a cool idea, but might get a bit weird on vertical monitors 😄
#
WinnerWind
[Murray]: oops! that was a remanant of something i was trying ^_^``
#
WinnerWind
i wanted 20vh to be the height, guess neurons got mixed up
#
[Murray]
ah that makes sense. You can try that on `grid-auto-rows: 20vh` or set the `img` element to `max-height`/`max-block-size` of `20vh`, I think that would have the effect you’re suggesting.
#
[Murray]
(I don’t use auto-rows a lot, so might not be completely right with that one)
#
WinnerWind
considering it, because if the height was set to 20vh then the taller images become far too small
decipaliz joined the channel
#
[Murray]
“small” might not always be that small with a `vh` unit though. I have a 4K widescreen monitor in vertical orientation, so I imagine they’d be pretty large on that 😄
#
WinnerWind
oh i meant as in if i had a image that is taller than it is wide then it looks tiny
#
WinnerWind
with a grid it is legible even on small displays as it takes up as much area as the grid allows it
#
[Murray]
can always set a min-height as well to prevent that e.g. `min-height: 5rem; height: 20vh;`
#
[Murray]
but yeah that looks nice 🙂
#
[tantek]
[Murray] agreed with separate page per individual image in lightbox. Makes for better permalinks too
#
[tantek]
Now with nav transitions you can even make it feel seamless with no flash / blink
#
WinnerWind
right now for a 'lightbox ' clicking the image opens in a new tab
#
WinnerWind
it just works™
#
rubenwardy
I have a page per-album, but might introduce a page per photo to show in a light box and link back to the album. https://blog.rubenwardy.com/photos/
#
rubenwardy
I prefer to design to my preferred user experience. I guess with javascript, the per-photo page could automatically open as a lightbox on the album page. Without JS, it would just show the contents of the lightbox 🤔
GuestZero, revi and thatoddshade joined the channel
#
rubenwardy
Congrats. You've nerd sniped me. I'm going to do this tonight
bitauger and suki joined the channel
#
[tantek]
Nice. Looking forward to seeing the results!
[mikemai2awesom], WinnerWind, redshuffle, kishy, mcepl, [snarfed], lain`_, [Jo], neatnik, burgeonlab, kleb60, solonovamax, tetov, wtl, [artlung], _thegr8whoopdini, hedy, levatography[d], lanodan, benji, oxtyped, barnaby, Saige_Leah and strugee joined the channel
#
aaronpk
one step closer to mastodon supporting indieauth https://github.com/mastodon/mastodon/issues/31151
#
Loqi
[preview] [ThisIsMissEm] #31151 Support OAuth Client ID Metadata Documents
Ace, chrisburnell, stewalec, thatoddshade, jeremycherfas, troojg, jjuran and barnaby joined the channel