Minimal base css

15 Replies
Kevin Powell
Kevin Powell•2y ago
I would have liked to have seen a html { color-scheme: light dark; } thrown in there, but otherwise that's fantastic. I also love seeing the nice big line-height on there... so many people go 1.5 and, yeah it's better, but not better enough 😅
aolko
aolkoOP•2y ago
fork the gist 😛
Kevin Powell
Kevin Powell•2y ago
Might just make my own based on the recent video I did 😄
aolko
aolkoOP•2y ago
are you using this reset btw?
html {
box-sizing: border-box;
}

*::before,
*,
*::after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
html {
box-sizing: border-box;
}

*::before,
*,
*::after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
also try, not last child hack
>*:not(:last-child){
// w/e
margin: 0 0 20px 0;
}
>*:not(:last-child){
// w/e
margin: 0 0 20px 0;
}
Kevin Powell
Kevin Powell•2y ago
If I'm doing a minimal site, nah. The box-sizing: inherit is only useful if you know you'll be using 3rd party things, and these days, I think all 3rd party things assume you've reset it anyway 🤷 Also, if I'm doing a minimal starter, not even sure if you need to bother with it. It's so much less important than it used to be with layouts using flexbox and grid now anyway.
aolko
aolkoOP•2y ago
speaking of grid, still no way to fill the cols, like flex: 1; or span x?
Kevin Powell
Kevin Powell•2y ago
Like, if there are multiple rows and there's one lonely element at the bottom just hanging there by itself? If so, then no, but that's also not really what grid was intended for, just use flexbox then (since the rows are independent from one another)
aolko
aolkoOP•2y ago
[1][2][3][4]
[1][fill ]
[1][2][fill]
[1][fill][4]
[1][2][3][4]
[1][fill ]
[1][2][fill]
[1][fill][4]
or
[1][2][3][4]
[5][6][7][8]

[fill][3][4]
[ ][7][8]

you know, like big square spaces with span
[1][2][3][4]
[5][6][7][8]

[fill][3][4]
[ ][7][8]

you know, like big square spaces with span
Kevin Powell
Kevin Powell•2y ago
Well, you can do all of that, but you need to be pretty explicit about it... https://codepen.io/kevinpowell/pen/JjmVYmm/55a920e29e01b0fd8a5f81a5390b99aa
Kevin
CodePen
JjmVYmm
...
aolko
aolkoOP•2y ago
manually, yes, but how about with automatic flow/repeat? No matter the number of elements
aolko
aolkoOP•2y ago
No description
Kevin Powell
Kevin Powell•2y ago
How important is the order of the elements?
aolko
aolkoOP•2y ago
should be the usual first to last, ltr found a better set of samples https://grid-tiles.webflow.io/
CSS Grid Tiles
10 reusable modern grid layouts inspired by tile patterns, along with 8 tasteful  animations. Fully responsive and copy/paste ready for your next project!
Kevin Powell
Kevin Powell•2y ago
https://codepen.io/kevinpowell/pen/gOByaQb/7bf44797bf4e3d2034a4e628f7219906?editors=1100 That looks a bit like masonry, which will eventually come with grid-template-rows: masonry but might be awhile off (you can play with it in FF though)
aolko
aolkoOP•2y ago
saw a lib for that https://muuri.dev/
Muuri - Infinite layouts with batteries included
Muuri is a JavaScript library that creates responsive, sortable, filterable and draggable grid layouts.
Want results from more Discord servers?
Add your server