Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 4 years ago

Mobile first site, using CSS and BEM

Sodja Nathan O.•205
@NateOs
A solution to the Agency landing page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


How many media queries is too much, also how do I reduce the length of my css, aside from shorthand or perhaps SASS ?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Yakub•260
    @Yakub-Egamnazarov
    Posted about 4 years ago

    Hey Sodja, congrats on completing the project, it looks consistent in the required display width. Besides that, I would suggest using mixins in your SCSS files to include media queries for your CSS code, this will improve the speed of your project building. To visually improve your solution I would suggest using the transition CSS rule for a button or link elements when changing state, this would add a smooth transition. Cheers and happy coding.

    Marked as helpful
  • alec•775
    @AlecANL
    Posted about 4 years ago

    Hey, Sodja Nathan. I'm not an expert, but I use these media queries: very small: 320px, medium: 480px, big: 768px, bigger: 1024px, very big: 1366px, and very, very big xD: 1920px.

    This does not mean do you use all media queries. Do you use required in your website or application, etc...

    And if you want to reduce the size of your css bundle, you may use sass with minify sass

    Marked as helpful
  • eagermonument81•210
    @ixtk
    Posted about 4 years ago
    .bg-bottles {
        background: url("../images/desktop/image-gallery-milkbottles.jpg");
        background-repeat: no-repeat;
        height: 70vh;
        width: 25vw;
        background-size: cover;
        background-position: center bottom;
      }
      .bg-orange {
        background: url("../images/desktop/image-gallery-orange.jpg");
        background-repeat: no-repeat;
        height: 70vh;
        width: 25vw;
        background-size: cover;
        background-position: center bottom;
      }
      .bg-cone {
        background: url("../images/desktop/image-gallery-cone.jpg");
        background-repeat: no-repeat;
        height: 70vh;
        width: 25vw;
        background-size: cover;
        background-position: center bottom;
      }
    

    You could have used these individual selectors to set background image, then grouped the common properties

    .bg-bottles, .bg-orange, .bg-cone {
        background-repeat: no-repeat;
        height: 70vh;
        width: 25vw;
        background-size: cover;
        background-position: center bottom;
    }
    

    I don't know if you're using something to generate these. If not, you've duplicated code in this fashion in many places.

    • There's a horizontal scrollbar on desktop layout
    • At some widths, text is not properly positioned in the photography and design sections, they either fall out or have bad contrast
    • The contact link in mobile menu has small font compared to other menu items
    • There are padding inconsistencies on desktop layout near learn more links and photography and design section texts
  • Mwangi•0
    @kagai
    Posted about 4 years ago

    Am curious as to why we have to use flex-direction to row -reverse instead of just having the image begin on the HTML , is there a specific reason for doing that ?

  • Sodja Nathan O.•205
    @NateOs
    Posted about 4 years ago

    Will certainly use SASS for my next project,seems I have forgotten an awful lot of it. Thanks.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub