@py-code314
Posted
Hello,
Congrats on finishing the project 👏🏼.
I really like the code and I think I can help with a few minor things:
- I noticed that you changed
font-size
to 62.5%. You might wanna read this article before you do that - It's better to also add
max-width: 100%
to <img> in Reset. - It's good to use rem units for
max-width
in.card
instead of px to get better responsiveness - You can use rem units for padding and margin too. I think that makes it more responsive
- What about using 'padding' instead of 'height' in
.recipe__nutrition-table-cell
? - May be there's a better way to organize media queries! Group them together instead of writing at multiple places?
Finally a question for you! You added margin to .grid
. How did you come up with those values? I'm asking because I couldn't center the card vertically in the <body>
All the best. Happy coding🎉
Marked as helpful
@py-code314 I took the values from the figma project and then adjusted using the chrome PerfectPixel plugin and the screenshot. Overall there is a very big discrepancy between the figma design and the screenshot. If you want an identical solution to the comparison, then you have to play with the values yourself.
@py-code314 great feedback here, keep it up!
The only one I'd question is number 4. It's not always better to use rem for padding and margin. That will really depend on circumstance. Like padding in rem on the white box wouod be bad as it could make the content super narrow when people increase text size, especially on mobile. But margin-top in em on the elements within the recipe would make great sense as you'd always want that to scale with the text size.
What I'm saying is that point is a little more nuanced.
Also, just so you're aware the media queries being throughout the css is a result of the sass compile. That's how sass works - you write the media queries next to each bit you style then it compiles everything at the end. It's a good thing.