Design comparison
Solution retrospective
I was having trouble trying to name variables in sass it mentioned to use $ when naming variables. I kept receiving error messages I'm not sure if I simply didn't install properly or where my error happened. I didn't find the SASS doc very helpful, feel free to comment any resources that may be helpful. Thanks! :)
Community feedback
- @NehalSahu8055Posted about 1 year ago
Hello Coder 👋.
Congratulations on successfully completing the challenge! 🎉
Few suggestions regarding design.
- Replace
height:100vh
withmin-height:100vh
to properly center the card. - Use
pointer cursor
for user interactivity
button:hover { cursor:pointer; }
I hope you find this helpful.
Happy coding😄
Marked as helpful1 - Replace
- @beowulf1958Posted about 1 year ago
I feel you; I had trouble with Sass variables as well. Here is what I found out: Jessica from Coder Coder did a YouTube video "Sass and BEM for beginners." It's kinda long, but at time stamp (26:17) she discusses Css and Sass variables.
Your problem is most likely the 'namespace' requirement. You name your variable with $, then to use it you must reference 'namespace.$variable' Below is an example from one of my own projects (single-price-grid):
First, I named my variables in a partial:
$cyan: hsl(179, 62%, 43%); $yellow : hsl(71, 73%, 54%); $slate : hsl(218, 22%, 67%);
Then, when I went to use them in another partial, I started with @use, then referenced the namespace 'var' as a prefix to the variable.
@use "variables" as var; header { padding: 20px; * { margin-bottom: 30px; } h1 { color: var.$cyan; } h2 { color: var.$yellow; } p { color: var.$slate; } }
Hope this helps! And keep on coding.
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