Easy and more consistent layouts using subgrid

  Рет қаралды 48,550

Kevin Powell

Kevin Powell

Күн бұрын

Пікірлер: 86
@zachjensz
@zachjensz 3 жыл бұрын
Grandparent Grid
@fuzzypumpkin7743
@fuzzypumpkin7743 3 жыл бұрын
Ok, now I get why it has some advantages over just making each grid area a grid itself. You could do some more faffing with traditional grid to get the same effect, but this is probably clearer/better on more complex pages.
@ericmartin8192
@ericmartin8192 4 ай бұрын
I love the excitement in your voice when it just works.
@jcespinoza
@jcespinoza 3 жыл бұрын
Loved the Subgrid Awareness Month! 😄😄
@justinnobles3659
@justinnobles3659 3 жыл бұрын
6:45 grid-template-columns: repeat(auto-fit minmax(6ch, 20ch)) 1fr;
@eotikurac
@eotikurac 10 ай бұрын
oh, yea, that makes so much sense...
@yiannis_p
@yiannis_p Жыл бұрын
Been busting my head for weeks trying to do exactly this and i finally came across your video that solved all my issues! Thank you so much!
@eotikurac
@eotikurac 10 ай бұрын
i would bet you don't remember how the grid works from just glancing at the css. now imagine some other developer looking at it. css grid is a disaster.
@LaurelRonning
@LaurelRonning 3 ай бұрын
Stumbled across this video and it solved my problem perfectly! Thank you 🙏
@briancross4415
@briancross4415 3 жыл бұрын
Subgrid awareness month. I love it.
@ico0z
@ico0z 3 жыл бұрын
I use display: contents, to make the children of an element to follow grid of its parent.
@char2s476
@char2s476 2 жыл бұрын
you just made me learn another awesome css feature!!!
@MrDenertog
@MrDenertog 3 жыл бұрын
subgrid!!!!! @kevin: you can make it work with repeat function like this `repeat(2, minmax(6ch, 20ch) 1fr)` the length parameter is a space separated list (just like grid-auto-columns would work)
@riddixdan5572
@riddixdan5572 3 жыл бұрын
oh god, if this would release, so much stuff would be so much easier. I don't understand what the browsers are waiting for.
@dv4able
@dv4able 3 жыл бұрын
I think it's a challenge to add new tasks to render the page and keep it fast on most devices.
@tomasvidal424
@tomasvidal424 3 жыл бұрын
So cool kevin! Keep it up!
@Leyksnal
@Leyksnal 3 жыл бұрын
Thanks Mr Powell
@sharafmakahleh4125
@sharafmakahleh4125 3 жыл бұрын
Great video I suggest that you include the word css somewhere in the title/thumbnail, because most people work with css and don't even know it's a thing in css so they don't click the video
@progressisbeautiful1541
@progressisbeautiful1541 3 жыл бұрын
Safari implementation is expected at the big Apple event 2028.
@MrJloa
@MrJloa 4 ай бұрын
Tables redefined finally
@frankroos1167
@frankroos1167 3 жыл бұрын
If this doesn't turn you on, you either haven't understood it, or you have never made a more complicated layout. Probably both. ...and this is just scratching the surface... I'm gonna need a diving suit! Learning grid just so you can use subgrid once it is supported? NO WAY! Grid is awesome, even without subgrid. If you don't know grid yet, GO LEARN NOW! Subgrid will be a lot of cream on what is already a pretty tasty strawberry.
@drax6094
@drax6094 3 жыл бұрын
I had a couple situations recently where I really wanted to use subgrid for some cards I was creating, I had to do some awkward workarounds instead. I really hope other browsers jump on board :(
@johnwayne8059
@johnwayne8059 7 ай бұрын
Interesting!!!😅 Where to find the next part of subgrid? BTW, nice vids kev!😁👍🤟😎
@1981ilyha
@1981ilyha 3 жыл бұрын
I love grid!!!
@josvelema2362
@josvelema2362 3 жыл бұрын
Nice , that works so good. I would like to see how you would achieve the same layout with grid alone , just to compare and ofcourse to know grid better.
@KevinPowell
@KevinPowell 3 жыл бұрын
I don't think it's possible to be honest... One of the reasons I wish we had subgrid
@moreshwarp
@moreshwarp 3 жыл бұрын
Thanks!
@KevinPowell
@KevinPowell 3 жыл бұрын
Thanks a lot!
@kevincooper3834
@kevincooper3834 3 жыл бұрын
What is the css for zooming in and out unnecessarily?
@sasca854
@sasca854 3 жыл бұрын
They probably don't feel the need to implement it because grid is already fairly esoteric; subgrid probably wouldn't get used much until people become more familiar with grid in general.
@MultiHowdoyoudo
@MultiHowdoyoudo 3 жыл бұрын
@Riddixdan oh god, if this would release, so much stuff would be so much easier. I don't understand what the browsers are waiting for. They are waiting for Kevin to cover all of the advantages before releasing it
@aram5642
@aram5642 3 жыл бұрын
But we had this before, it was called 😂 But seriously, please do continue with subgrid! And use your Powell to make all browsers subgrid-savvy :)
@fuzzypumpkin7743
@fuzzypumpkin7743 3 жыл бұрын
Nooooo no bringing tables back! :)
@dave6012
@dave6012 3 жыл бұрын
I HAVE THE POWELL!!!
@filippotinnirello
@filippotinnirello 2 жыл бұрын
tables are independent like grids unless you fix the column width
@hussainfaizal8617
@hussainfaizal8617 3 жыл бұрын
this is awesome, but what about using flex put a fixed width ( in %) for the image container so that everything stays in the same fixed width?
@a.miroshin
@a.miroshin Жыл бұрын
I've just though the same way
@codedjango
@codedjango 3 жыл бұрын
When is subgrid gonna be integrated with other browsers apart from Firefox? any idea?
@BasicallyWiz
@BasicallyWiz 3 жыл бұрын
The reason Kevin is hosting this "Month of subgrid" is because no browsers plan to implement subgrid, other than Firefox, which has it already implemented.
@clevermissfox
@clevermissfox 10 ай бұрын
Which is the video that explores the “gotchas” with grid-template-rows: subgrid ?
@FanniTakacs-ez3dn
@FanniTakacs-ez3dn 8 ай бұрын
This one for example: kzbin.info/www/bejne/iGjEeZadfsp0iqc
@xXxLYnXxXx
@xXxLYnXxXx 3 жыл бұрын
very nice :) thx
@carolmckay5152
@carolmckay5152 Жыл бұрын
grid-template-columns: repeat(2, minmax(6ch, 20ch) 1fr);
@udoheinz7845
@udoheinz7845 3 жыл бұрын
I am working as an Web Dev and I just can t use grid because we make webistes for big companys and there is still a big nuber of users using ie.... But in a recent project for a smaller company I used it and it works fantastic....
@dave6012
@dave6012 3 жыл бұрын
I work in web dev and we said fuck the IE users a long time ago.
@udoheinz7845
@udoheinz7845 3 жыл бұрын
@@dave6012 I would also love to but sadly the data shows that quite some people use it...
@dave6012
@dave6012 3 жыл бұрын
@@udoheinz7845 that sucks man… I’m glad I work for a forward thinking company.
@udoheinz7845
@udoheinz7845 3 жыл бұрын
@@dave6012 it all good. we joked about having a party when ie support ends in 2022
@KevinPowell
@KevinPowell 3 жыл бұрын
Google, Netflix, Facebook, Twitter, LinkedIn, AWS, and even Microsoft, among many other of the biggest sites on the internet today have already stopped bothering to keep supporting it... It's time to let it go 🙂
@web-atelier
@web-atelier Жыл бұрын
Hi Kevin, thanks for this video. I was wondering what to do when you want to define a specific size in the subgrid. For example, you always want an image to be 250px height ?
@VOXGeneration-Freiamt
@VOXGeneration-Freiamt 8 ай бұрын
Is it working too width the grid-template-rows?
@dasten123
@dasten123 3 жыл бұрын
interesting!
@bs8028
@bs8028 3 жыл бұрын
Did anyone try this with sass ? How it compile to other browsers ? Many we can use it like it’s already implemented:)??
@davidricebowled
@davidricebowled 3 жыл бұрын
I originally came to comment to say it's easy to repeat the `minmax(6ch, 20ch) 1fr` but that's been covered already. But I'm curious as to how we might persuade browsers other than Firefox to implement subgrid, is there a particular strategy that's recommended? Do we just email Sundar Pichai, or something?
@peacemekka
@peacemekka 2 жыл бұрын
how does this work with `grid-template-areas` ? or is it not possible to do it with areas?
@Atractiondj
@Atractiondj Жыл бұрын
This is all great, but for example, I haven’t found any practical use for subgrids and container queries for a year now. I still think this is absolutely useless while we have Grid and Flex and if you know how they work then you will not have situations where you need these new options. But I do not deny that one day I will find an area where I cannot do without it.
@jsuddsjr
@jsuddsjr 3 жыл бұрын
Firefox only. 😭
@KevinPowell
@KevinPowell 3 жыл бұрын
I know 😢
@MS-gn4gl
@MS-gn4gl 2 жыл бұрын
In the example you showed at 2:37 they do not behave the same - it's pretty obvious the left column is not behaving the same as the right column once it gets narrower. I'm assuming that's due to the subgrid being set at the column level? Is there anyway to counter that and ensure they're constantly the same?
@adamadequate4596
@adamadequate4596 2 жыл бұрын
It's because one of the columns has a larger intrinsic size than the other (the longest unbroken word is longer on the left). This means not all 1fr columns will be the same in order to prevent the content overflowing. Outside of this, the columns on the left and right will be the same at all widths until you hit this lower limit. If you really really don't want this to happen you can use minmax(0, 1fr) instead of 1fr, but your content will overflow in that instance instead of becoming unbalanced. Source: Debugging CSS Grid: Part 2: What the Fr(action)?
@kuldipkumar3363
@kuldipkumar3363 3 жыл бұрын
Can you please tell me how to stop layout breaking when we zoom in or zoom out the browser window please make a video on this topic
@dave6012
@dave6012 3 жыл бұрын
I know I’m not kevin, but in my experience having a good layout at all widths will prevent layout from breaking on zoom. Zooming has the same effect as width shrinking on layout. Also, use rem/em instead of px for all your sizes. Happy coding!
@Stoney_Eagle
@Stoney_Eagle 3 жыл бұрын
Interesting... Instead of working inward with styling, subgrid works outward. Why is this only implemented in Firefox 😡 My main user base is on Chromium, Safari and Samsung. 😞
@caitlinpillay3224
@caitlinpillay3224 3 жыл бұрын
cool shirt
@SteveRaynerMakes
@SteveRaynerMakes Жыл бұрын
is subgrid supported on all major browsers?
@eotikurac
@eotikurac 10 ай бұрын
yes, but it's a terrible way to build layouts.
@OzoneGrif
@OzoneGrif 3 жыл бұрын
Only FireFox supports subgrid ?
@yajirushik2871
@yajirushik2871 3 жыл бұрын
He did it lol
@lenarnie2973
@lenarnie2973 2 жыл бұрын
so sad to see subgrid is still not supported by other browsers :/
@scnix
@scnix 3 жыл бұрын
but subgrid is still unsupported by most browsers :(
@studiosoftmorecambe6879
@studiosoftmorecambe6879 3 жыл бұрын
Have I got this right, we have happily done this with divs for many years so the experts gave us the complication of grid which introduced resizing problems. To get over this they introduced subgrid to make grids behave like divs on their own do - CSS has lost the plot.
@eotikurac
@eotikurac 10 ай бұрын
you're absolutely right. i've been out of the loop for less than two years and i cannot understand any of the new website layouts. it's all cryptic and i would bet not even the people who built it can understand what's going on.
@realist8774
@realist8774 3 жыл бұрын
Pfff, this can be easily done with Hahaha
@eotikurac
@eotikurac 10 ай бұрын
so, basically grid is useless (yes, useless) without subgrid, and until recently it was not supported very well. this is what happens when people want to be too clever. i was perfectly comfortable with limitations of floats and display inline block but when flexbox came out, and later grid, i now don't know what layout is possible or not. i cannot tell my designer, hey this doesn't work anymore because the tools are becoming to complex.
@Knards
@Knards 3 жыл бұрын
What the heck is 6ch, 20ch?
@jcespinoza
@jcespinoza 3 жыл бұрын
ch is a unit of measurement
@gilsinhonunes
@gilsinhonunes 3 жыл бұрын
Ch stands for character. One ch is the width of the character 0 (zero).
@Knards
@Knards 3 жыл бұрын
@@gilsinhonunes Thank you. Never heard of them
@abhim6380
@abhim6380 3 жыл бұрын
@@gilsinhonunes why does it exist
@gilsinhonunes
@gilsinhonunes 3 жыл бұрын
@@abhim6380 it’s for keeping lines with a good amount of characters so the legibility is good. For example, you can set a max-width of 65ch on all of your paragraphs, no matter what the font-size or font-family you use.
@vasekcz
@vasekcz 3 жыл бұрын
Ok
@diegooliveira1083
@diegooliveira1083 3 жыл бұрын
ok
@zweisser
@zweisser 3 жыл бұрын
dont see the difference
@comradecid
@comradecid 3 жыл бұрын
please please please make the bubble of your head smaller or get rid of it. i can't see the code because it's hidden by your face.
Creating a robust grid system using subgrid
36:22
Kevin Powell
Рет қаралды 44 М.
Flexbox is more complicated than you thought
22:42
Kevin Powell
Рет қаралды 154 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 132 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,5 МЛН
Thank you Santa
00:13
Nadir Show
Рет қаралды 29 МЛН
Subgrid & Container Queries change how we can create layouts
21:08
Kevin Powell
Рет қаралды 78 М.
Flexbox or grid - How to decide?
18:51
Kevin Powell
Рет қаралды 743 М.
The new CSS pseudo-classes explained - :is() :where() :has()
13:50
Kevin Powell
Рет қаралды 141 М.
Getting started with CSS nesting
27:14
Kevin Powell
Рет қаралды 74 М.
Flexbox design patterns you can use in your projects
15:33
Kevin Powell
Рет қаралды 444 М.
A new approach to container and wrapper classes
25:27
Kevin Powell
Рет қаралды 268 М.
You can't do this without subgrid
10:49
Kevin Powell
Рет қаралды 17 М.
:has() opens up new possibilities with CSS
14:30
Kevin Powell
Рет қаралды 288 М.
Learn CSS Grid the easy way
37:04
Kevin Powell
Рет қаралды 933 М.
Two simple layouts that work better with Grid
14:05
Kevin Powell
Рет қаралды 62 М.