Why does the grid class exist? #555
Replies: 3 comments 5 replies
-
@dev-willis please see my notes here: #582 |
Beta Was this translation helpful? Give feedback.
-
its pretty useful for concise modification like this one liner is pretty nice to add to your grid classes. grid-template-columns:repeat(auto-fill, minmax(300px), 1fr)) |
Beta Was this translation helpful? Give feedback.
-
I'm glad there's a classless version, so you can have your cake, and eat it too. That being said, I also see a lot of value in .grid, since you can achieve a lot with very minimal weight... I would like to suggest the use of variables. With a tiny change to the current .grid class, we can actually open a lot of possibilities: (I didn't put much thought into the variable names...):
Now we can do cool things like <div class="grid" style="--pico-grid-cols: 5">
<div style="--pico-grid-col-span: span 2">1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div> |
Beta Was this translation helpful? Give feedback.
-
I understand that providing a complete grid system is beyond the scope of Pico and I think this is the right choice. So why provide the
.grid
class at all? It breaks separation of concerns by describing presentation in the structure, doesn't apply in every situation and so is semantically problematic, and it can't be used without writing custom CSS anyway so it doesn't really save any time. So why not drop it and shave a little weight off? Or is there a use-case I'm not seeing?Beta Was this translation helpful? Give feedback.
All reactions