Design comparison
Solution retrospective
I used display grid to make the column and add
position:relative; top: -50%;
If there any best practice to do it, please kindly add in comment. Thank your
Community feedback
- @grace-snowPosted over 3 years ago
Hi
This looks good and the html is spot on!
I recommend some changes to how you are writing scss.
You are nesting very heavily at the moment. As well as making it very hard to read, you're really increasing specificity there and it is not recommended.
Instead, try writing your scss where you only nest pseudo states, pseudo selectors, media queries or direct children selectors.
// eg. Instead of this .my-class { // styles .child-class { p { ... } } } // Try this .my-class { // styles @media-query... { ... } } .child-class { ... }
I can't understand what you're doing with the grid and position relative I'm afraid. The whole point of css grid is you create the grid template and let that handle the layout, sizes and spacing of the grid children. It sounds like you are breaking children out of their grid position unnecessarily. Create the grid and place the cards on it where they need to be.
Last pointer - make sure you put the font size on the body in rem not px. Never put font size in px as it cannot scale for people with different zoom settings.
I hope this helps.
1@madegilangadityaPosted over 3 years ago@grace-snow thanks for your suggestion grace, I will fix my SCSS for future challenge. I use position relative because I didn't figure out how to make the grid column position more to the top.
0@grace-snowPosted over 3 years agoLearn more how to use grid. You need to plan out the grid and set up rows and columns. Maybe look into grid-template areas too you might find that easier
0@madegilangadityaPosted over 3 years ago@grace-snow thanks grace I will look it up..
0@RocTanweerPosted over 3 years ago@grace-snow Hello, how deep nested should be in sass? And what to do if it goes any deeper?
I totally follow BEM and 4-5 level nesting is very common in my code...
Please help me
0@grace-snowPosted over 3 years ago@RocTanweer I rarely go deeper than 1-2 levels. I only nest media queries and pseudos usually.
Even if you follow an approach of a parent class with element selectors, there is no good reason to nest deeper than 3 levels I think
0 - @RocTanweerPosted over 3 years ago
You did really good, Almost pixel perfect 🎉 there are multiple ways to do the same job...
Every developer has their own way to complete a task
Good luck 😃
1 - @jmnyaregaPosted over 3 years ago
Using
position
is also an acceptable approach. I usedgrid layout
& it worked as well.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