#CssSubgrid

Ana Tudor 馃惎anatudor
2025-01-03

Saw youtube.com/watch?v=An3QMWg3m1c linked last evening & gave the challenge a quick go myself.

My approach was a mostly one, with minimal HTML (no extra wrappers) and JS (used only to update top item index, ~200 bytes minified).

While it was working, it wasn't pretty, so today I polished the demo & heavily commented the CSS - check it out on @codepen: codepen.io/thebabydino/pen/jEN

Ana Tudor 馃惎anatudor
2024-08-28

We add a `.shape` element which in also covers all of the 4 cells of its parent's grid and also inherits its `.back` parent grid via `subgrid`.

This element creates our shape via two pseudos positioned in the 1st grid cell (clipped) and across the 2nd column (avoiding heading).

Ana Tudor 馃惎anatudor
2024-08-28

We create a 2脳2 header grid with the height of the 2nd row and the width of the 1st column given by the dimensions of the element (the heading) in the cell where they meet.

We also have another `.back` element covering all 4 grid cells & inheriting parent grid via `subgrid`.

2脳2 grid on header.

`.back` stretches across all grid cells & inherits this grid.

Heading just in bottom left cell.

Screenshot showing the grids highlighted via DevTools. The width of the first column is given by the amount of text content inside the heading.
Inautiloinautilo
2024-04-03


How to align column rows with CSS subgrid 路 Aligning content of boxes that sit side by side ilo.im/15ydwz

_____

Ana Tudor 馃惎anatudor
2024-02-23

If you're a $5+ patron on Patreon, I've just posted a very special and cool interactive demo. With explanations about the concepts it illustrates + the demo itself is heavily commented as the viewport-adaptive layout part is very interesting too.

patreon.com/posts/swap-channel

Inautiloinautilo
2023-09-29


CSS Subgrid 路 Introduction, use cases, examples, and resources ilo.im/15a4kz

_____

Inautiloinautilo
2023-09-12


Creating a CSS subgrid utility class for rows 路 Level up your design system with a new CSS feature ilo.im/157rc1

_____

Inautiloinautilo
2023-06-13


Rebuilding a comment component with modern CSS 路 How to craft a state-of-the-art CSS comment section ilo.im/13js3h

_____

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst