What specific areas of your project would you like help with?
tables are tricky to style - I couldn't reproduce all the spacings as in the design. Could it be semantically correct to implement the Nutrition section in flex or grid
in one of the reviews of this exercise it was mentioned that it can be done
without media queries.
But how to tackle the transition from padded rounded view on tablets to a fully snapped one on mobile?
What are you most proud of, and what would you do differently next time?
In this exercise, I used fluid fonts and margins, instead of media queries.
For example, to accommodate very small viewports, I want the margins to gradually disappear
and the font size to shrink:
const Wrapper = styled.article`
// From 0 to 24px on screens below 375px
margin-inline: clamp(0rem, -7.5rem + 37.5vw, 1.5rem);
`;
const Title = styled.h1`
// Grow from 20 to 24px on vewports between 375 to 450px */
font-size: clamp(1.25rem, 0rem + 5.333vw, 1.5rem);
`;
Another new thing was the animation. I didn't want the shadow to disappear instantly in the active state
but to subtly move under the card. It was pretty simple to achieve with the transition of the filter property.
What challenges did you encounter, and how did you overcome them?
It was tricky to figure out how to prevent vertical and horizontal content loss on smaller viewports,
e.g. less than 320px (see the screen recording). Here's the snippet that worked for me (and resulting recording):
const Main = styled.main`
...
min-width: fit-content;
min-height: 100%;
display: flex;
justify-content: center;
align-items: center;
`;
const CardWrapper = styled.div`
// Don't grow horizontally more than minimally possible to contain the card
// I guess it works because nested image has fixed dimensions
max-width: min-content;
...
img {
display: block;
width: 288px;
height: 288px;
}
`;
What challenges did you encounter, and how did you overcome them?
After I've centered the parent container using Grid's place-content: center, I noticed the broken vertical scroll behavior on low-height viewports - content was spilling beyond viewport without possibility to scroll. The fixed min-height feels too hacky. Is there a better way?