Design comparison
Solution retrospective
I am proud of getting a good lighthouse score on this project.
What challenges did you encounter, and how did you overcome them?One challenge I faced was naming classes and distinguishing between them later while styling.
What specific areas of your project would you like help with?I would be grateful if someone could improve my js. I tried to make the solution as simple as possible.
Community feedback
- @mkborisPosted 5 months ago
Hi rohantayal
To get the required outcome, you'll need to to use the JSON data provided to dynamically change the ui based on the selected timeframe, there are some great resource in the JavaScript fundamentals Learning Path to guide you.
Also, some suggestions that might be of interest to you,
- Font-size should be written in rem not px. This article explains it better Why font-size must NEVER be in pixels.
- Avoid setting fixed heights and widths on elements as this will cause lots of issues with the responsiveness of your layout, the element's content and using padding should determine it's size. Use max-width or min-height if you absolutely have to and the units should be relative units like rem.
- Media queries should be defined in rem or em not px.
Hope this helps.
Marked as helpful0@rohantayalPosted 5 months agoHi @mkboris
Thank you so much for the useful tips. I have used the JSON data to dynamically change the UI based on the selected timeframe.
For the second suggestion of never using px. Does this also apply to margin and padding?
0@mkborisPosted 5 months agoYes, you should use
rem
almost all the time because it scales with the base font-size set in the browser. Useem
when you want a component to scale with the font-size of the current element, a button's padding is a great use case forem
. Only usepx
on something you don't want the size to ever change.0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord