Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Single Price Grid with Sass

evannor 70

@evannor

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I struggled getting media queries to work well within the Sass environment. Please let me know if you have any advice for refactoring or general setup.

Community feedback

Connor Z 5,115

@zuolizhu

Posted

Hi evannor,

Nice work on this project!

The media query works same on both css and sass environment, except in css, you have to wrap your code within the media query.

For example, in css, responsive for a component:

.box {
  width: 50%;
}
@media (min-width: 600px) {
  .box {
    width: 100%;
  }
}

But in sass, you can do either

@media (min-width: 600px) {
  .box {
    width: 100%;
  }
}

or

.box {
  @media (min-width: 600px) {
    width: 100%;
  }
}

They both works.

I personally like to write css from mobile size to desktop size. (AKA mobile first)

Then instead of writing @media (max-width), writing @media (min-width)

This approaching makes it easier to debug, since you are always thinking the changes from small size to bigger size.

I hope my poor English explained clearly 😂

And last but not least, here is a series videos I found that really useful for responsive css: https://www.youtube.com/playlist?list=PL4cUxeGkcC9hH1tAjyUPZPjbj-7s200a4

Happy coding!🙌

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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