Design comparison
Solution retrospective
Hello there everyone! I am trying to be good at this. I am trying my best. Fell free to pass on your valuable opinion and PLEASE correct me where you think I could do batter! :)
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there ๐. Congratulations on successfully completing the challenge! ๐
- I have other recommendations regarding your code that I believe will be of great interest to you.
BODY MEASUREMENTS ๐:
- The
width: 100vw
property forbody
element is not necessary. because it's a block level element which will take the full width of the page by default.
- Use
min-height: 100vh
forbody
instead ofheight: 100vh
. Setting theheight: 100vh
may result in the component being cut off on smaller screens, such as mobile devices in landscape orientation.
- For example; if we set
height: 100vh
then thebody
will have100vh
height no matter what. Even if the content spans more than100vh
of viewport.
- But if we set
min-height: 100vh
then thebody
will start at100vh
, if the content pushes thebody
beyond100vh
it will continue growing. However if you have content that takes less than100vh
it will still take100vh
in space.
.
I hope you find this helpful ๐ Above all, the solution you submitted is great !
Happy coding!
Marked as helpful1@rakibhossainrajuPosted over 1 year ago@0xAbdulKhalid Thanks a lot for your helpful suggestions โบ๏ธ
0 - @NehalSahu8055Posted over 1 year ago
Hello Coder ๐.
Congratulations on successfully completing the challenge! ๐
Few suggestions regarding design.
- Remove
commented line
from the code and replace height with min-height for proper centering the card.
body { display: flex; justify-content: center; align-items: center; min-height: 100vh; /* width: 100vw; */ /* overflow: hidden; */ cause not able to scroll. }
โจSetting an element's
width to 100vw
makes it as wide as the current viewport. But doing that is bad practice. First, it is almost always unnecessary. A block element, by default, already takes up all the available width. Setting the width manually is not needed in that situation.โจ You can use
accessibility features
likearia, sr-only, and title
which are accessible to screen readers.I hope you find this helpful.
Happy coding๐
Marked as helpful1@rakibhossainrajuPosted over 1 year ago@NehalSahu8055 I implemented the changes and it helped. Thank you for your constructive comment ๐โบ๏ธ
0 - Remove
- @GrzywNPosted over 1 year ago
Hey Kira!
Things worth considering:
- Adding ESLint and Prettier to your project to make code practices and formatting consistent
- Splitting big components into smaller ones
- Extracting app logic into utils and hooks (like calculating relative dates etc.)
Have a nice day and keep coding!
1
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