Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Intro component with signup form (used SCSS and Vanilla JS) Newbie

sass/scss
P
David Pokrajac•600
@DavidPokrajac
A solution to the Intro component with sign-up form challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


This is my version of Intro Component with Signup Form (https://www.frontendmentor.io/challenges/intro-component-with-signup-form-5cf91bd49edda32581d28fd1) newbie project. The area of which I'm not unsure is definitely the JavaScript part, so please provide a feedback of pros and cons of my way. Also, I have a quesstion about best practices with sass, should I have made different files for variables and globals for this project, or was it enough to put it all under one main sass file.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • beowulf1958•1,930
    @beowulf1958
    Posted over 1 year ago

    Congratulations on completing this challenge; it looks great. The css is well organized and very readable.

    As to the Sass: I am a total newbie, so take this with a grain of salt. What I have observed is that the more experienced coders put all their sass files (main and partials) in a separate sass folder, which keeps the site more organized. Also, on small projects like this one, it is enough to put it all under one main sass file. However, many coders separate their globals and variables in such a way as to be scalable; they practice in a small project the type of organization they would follow on a larger project. In the end, you follow the system that makes sense to you.

    Marked as helpful
  • P. Ricardo•2,370
    @pRicard0
    Posted over 1 year ago

    Some HTML tips

    • Everything inside the form should be wrapped inside a <fieldset> which will have a <legend> that is visually hidden using CSS. The legend tag is like the label of the form.
    • The error message is invisible but auxiliary devices can still read it. The message must contain aria-hidden="true"
    • The input must contain aria-invalid. It is used to indicate whether the value of an input field or form control is valid or invalid for the user. You should update the value using Javascript. aria-invalid should be true or false.
    • You should use aria-describedby. The aria-describedby attribute lists the ids of the elements that describe the object. It is used to establish a relationship between widgets or groups and the text that describes them. In short, it is used to associate the input with the error message in this case.

    CSS tip

    • You can add a transition to your "input type submit". Like... transition: 200ms;
    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

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