CSS Grid not resizing on media query with new grid-template-columns
Full disclosure: I'm working in react using react.modules.css file structure.
I originally set up my grid-template-column as 1fr 1fr auto 2fr and I'm trying to change it to just a 1fr 1fr structure at smaller screen sizes. Not entirely sure what I'm doing wrong.
https://cherished-moments.vercel.app/ current deployed version of the code.
CSS
Create Next App
Generated by create next app
27 Replies
1000 is not valid unit
you just forgot the px is all 😄
... Thank you 😂
Few tips though don't use heading levels for font sizes they should make semantic sense, also grid-gap is not a thing anymore its just
gap
Also if you use multiple <nav> elements you need to give them names with different aria-labels for a11y 🙂Gotcha. In the case of a footer is there any heading that should be used?
nope
I wouldn't use a heading level for them at all
make it a <b>
size it how you want in css
any particular reason for using b?
nope I just like to 😂
if I want something bold and don't need it to be readout differently
<strong> if I do
Just one less thing to write in css 🤷♂️
Thank you!
typically I would have a .title-sm util class or something too so it would only be the size but I could make it bold with <b class="title-sm"> if that makes any sense
just a b thang
Or I would just have that bold anyway and control lthe boldness with the class and still use <b> lol (lots of people will disagree with this though so thats a choice for you to make)
So on set-up you'd have h1, title-xl {}, h2, title-l {}, h3 title-m {} etc?
YUP!
I might separate them too depends on the design/sytem. Like if for some reason I had h2's that I want visually small
but lots of times you can do like <h2 class="title-m"> in the case you setup
Gotcha, makes sense. I'm still trying to learn best practices and definitely have a lot to learn for sure
np! you are doing great keep it up
oh one last tip 😂
You are getting overscroll here I think cause the padding is on your wrapper class
oh no I'm wrong sec
I just now realized that
I would still put the padding on <footer>
I'm not sure whats causing the h-scroll 😮
Forgive my ignorance but h-scroll?
gah I love these wrappers ❤️ glad you are paying attention to Kevins recent stuff
Horizontal scrolling
This is one those times I still wish I had Polypane browser.. I need to renew my sub
Might want to open a new post for this and get some fresh eyes on that one. ( I need sleep bad)
quick hack would be to set
overflow-x: hidden;
on body but its just a hack not solving the actual overflowI'm probably going to let it ride until tomorrow as well.
found it 😂
🙃 -sigh-
So put
overflow: hidden;
on .page_decorative
or the p child not sure. but thats your culpritBtw instead of having to redeclare all the grid columns and grid rows in the media query, you can give the children grid-areas and save yourself a lot of grief. Make them more meaningful names but for this example I'll just something generic.
Instead of redeclaring all the children's grid-column or grid-row, you just redeclare the grid-areas in your grids