when to use subgrid
i want to start another FEM challenge -> https://www.frontendmentor.io/challenges/news-homepage-H6SWTa1MFl
when i look at the design, i feel like subgrid is appropriate, but i don't have any experience (yet) using it, and just wanted to check whether that is overkill or not.
what do you guys think?
Frontend Mentor
Frontend Mentor | News homepage coding challenge
This news homepage will be an excellent opportunity to practice your CSS Grid skills. There will be lots of tricky decisions to make and plenty of learning opportunities!
11 Replies
also, i feel like subgrid can/will be used for like everything regarding bigger page layouts now
for this layout I don't really see a purpose for subgrid really. I think a single 3x3 grid would be enough
i was thinking the same, yet i still feel subgrid might come in handier because of the way the HTML would be structured?
Ah i get what you mean.
so you dont have to put all in 1 container
there is a little tick you can do for that
when you have the maincontainer display grid;
you can give subsections the display of "contents". then the items within will be part of the main grid
small example
https://codepen.io/MarkBoots/pen/MWXpGQQ
wasn't there accessibility problems with
display: contents
?not when there are regular elements inside of it. it is only used as a wrapper
nope, never mind
yes, just read on MDN
just as ref, a screenshot of my pen because it will be deleted in a few days
it does play a bit funky when trying to
get auto-flow: dense
working (however that was just some hypothetical testing to get better understanding on how it works)yea, i think the dense can be tricky sometimes
maybe it will be better to control with subgrid. (i just used this because there was no subgrid back then, and is still not fully supported now)