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

Newsletter Sign Up using sass and css flexbox

accessibility, itcss
P
Daniel Basilio•420
@danielbasilio
A solution to the Newsletter sign-up form with success message challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm very proud of the responsive layout made using CSS grid. In the future I would focus on improving the separation of components within sass

What challenges did you encounter, and how did you overcome them?

The project as a whole was quite challenging. It took me a long time to finish, as I am a beginner in React. I had to study the framework throughout all stages of development.

What specific areas of your project would you like help with?

I believe that the entire architecture can be improved.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Rupali•890
    @rupali317
    Posted 11 months ago

    Hello @danielbasilio

    Front-end mentor team requested me to review your code and provide feedback since I am following the Javascript learning path and I have also finished this particular challenge. It is my pleasure reviewing your code and offering suggestions for the code improvement:

    Your HTML code is semantic (especially how you used the address tag and the picture tag).

    My suggestions:

    • In the browser, when I altered the font settings to large, I noticed that some of the font sizes did not scale accordingly. This is because you used px as font size. I suggest you use rem unit to make the fonts scalable otherwise the text will not be accessible to those who rely on bigger font size via browser.

    • You used an inline style of display:block and display:none. You can eliminate the usage of this inline style and instead toggle the appearance of hide-error class. element.classList.toggle("hide-error") will achieve it. Classes have lower specificity than inline styles.

    • The javascript functions like displayError and enableButton can be renamed as toggleInlineError and toggleButtonState respectively. The former names did not convey the actual functionality and hence it becomes difficult to understand the code at an initial glance.

    • When I typed the correct email, I expected the disabled state of the button to go away. But it did not do so. It is a bug. In your "displayError" function, you also need to handle the state of the button. So based on that, please rename the function accordingly so that the purpose of the function is conveyed.

    • The variables in the javascript are well named. One point where you can improve the performance is not to always use document.querySelector(). I want to highlight the document part since it will check from the entire document. It is doing so 6 times since you declared 6 variables. You can improve it in this way:

    const $formSignUp = document.querySelector('[data-js="form-sign-up"]');
    const $emailField = $formSignUp.querySelector('[data-js="form-email-field"]');
    const $btnSubmit = $formSignUp.querySelector('[data-js="form-btn-submit"]');
    const $modal = document.querySelector('[data-js="modal"]');
    const $btnModal = $modal.querySelector('[data-js="modal-button"]');
    const $errorMessage = $formSignUp.querySelector('[data-js="error-message"]')
    

    In the above example when I want to select an email field, I do not have to use document again since I have already searched sign up form. To select the email input, I can search it from the sign up form rather than combing the document again.

    • The modal component's email should be based on what the user has typed on the email input field. Currently it is ash@loremcompany.com. Also, it is nice to see that you have made the email address as a link. However, clicking on that email is showing a 404. I think you wanted to open an email. To do so, you need change it as: <a href="mailto:ash@loremcompany.com" title="Confirm your email" class="link">ash@loremcompany.com</a>

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