[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
[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]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]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]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
[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]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
[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 😄
[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]“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 😄
rubenwardyI 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