Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

HTML5 + SCSS Level up! Clean and efficient code!

Daniel•250
@daniel-hennig
A solution to the Fylo landing page with two column layout challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


  • FLUID responsiveness (layout and fonts)
  • well structured and organized code
  • good accessibility
  • pixel-pretty-close
  • @font-face integration
  • SEMANTIC html, scss, vanillaJS

What is your opinion, especially on the the HTML5 markup on the .testimonial-card? Note: I've used '.author-container' in order to place the author's avatar within its pseudeo-element ::before. Is there anything, in your mind, to improve the structure/ organization in the code?

As always, I appreciate ANY kind of feedback :)

Special thanks to @pikamart, who helped me with his feedback on the previous challenge. This community is awesome.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raymart Pamplona•16,040
    @pikapikamart
    Posted over 3 years ago

    Hey, really awesome work as well on this one. Desktop layout is really great, it is responsive and the mobile state looks really great as well.

    Some suggestions would be:

    • For a fluid layout, I always use this function that I created in scss:
    # I separate this module 
    @use "sass:math";
    
    @function rem($px) {
      $value: math.div($px, 16) + rem;
      @return $value;
    }
    
    @function fluid($min, $pref, $max) {
      $size: clamp(#{rem($min)}, #{$pref}, #{rem($max)});
      @return $size;
    }
    

    And on any properties that requires number value, I could just use like: link to my scss structuring

    # 
    @use "_functions.scss" as func;
    
    font-size: func.fluid(16, 1.4vw, 18;
    padding: func.fluid(32, 7vw, 56) func.fluid(48, 17vw, 80);
    margin: ...
    max-height:...
    

    Though you will need to use the dev tools a lot to get the proper preferred size, the middle one value. I kept it as close to the original clamp.

    • Website-logo- link a tag should either use aria-label or screen-reader only text inside it, that defines where this link would take the user. Since typically a website-logo links to homepage, use "homepage" as the value for what ever method you will use.
    • On your logo-svg, you should do it this way for the title to work properly.
    <svg aria-describedBy="logosvg">
      <title id="logosvg"> fylo </title>
      the rest of the svg code
    </svg>
    

    Though I prefer using svg as the src value for the img so that I will just have to use alt.

    • Another idea is to create your own visual indicator like this:
    .element:focus-visible {
      outline: 2px dashed your color;
      outline-offset: 3px;
    }
    
    • I would make the hero-section-image hidden personally since it is just a vector. Also, again, avoid using words that relates to "graphic" such as "illustration" and others. An img is already an image/graphic so no need to describe it as one.
    • For a form that submits, use method="post" .
    • Also for the input just to post this again:
    if ( input is wrong )
      input.setAttribute("aria-invalid", "true");
      input.setAttribute("aria-describedBy", id of the error-message);
    else 
      input.removeAttribute("aria-invalid");
      input.removeAttribute("aria-describedBy");
    

    The error-message element should have an id attribute which is referenced by the aria-describedBy attribute on the input element. By doing that, your user will know that the input is wrong because of aria-invalid and they will know what kind of error they made because of the aria-describedBy

    • Another idea to implement to further improve accessibility is to have an aria-live element that will announce if the form submission is a success or not. Posting this again for reference for accessible form
    • For the testimonial, I found out yesterday's discussion on the fem slack, you could use this markup:
    <figure>
      <figcaption>
        image in here
        person name in here
        person position in here
      </figcaption>
      <blockqoute>
        quote in here
      </blockqoute>
    </figure>
    
    • Person's image should be visible since it is all about the person so add a alt with their name as the value.
    • Adding cursor: pointer to the button on desktop layout would be great.
    • Also to be honest, I would put aria-label="submit email form" for the button because get started is not really clear right.

    FOOTER

    • Same for the header-logo-website-link use it on the footer as well.
    • When you use aria-hidden="true" on an img, make sure to use alt="" as well since you are hiding it right.
    • Use only 1 ul on those navlinks sine those are related links.
    • Lose the word link on the social-media a tags since a tag is already a link.

    Aside from those, site looks really great again.

    Marked as helpful

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
Frontend Mentor logo

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