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

Flexbox / Grid + Simple input validation via Regex / vanilla JS

Patricia Hurst•80
@patricia-hurst
A solution to the Base Apparel coming soon page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I'd love feedback as I am still learning (especially JavaScript)!

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raymart Pamplona•16,040
    @pikapikamart
    Posted almost 4 years ago

    Hey, awesome work on this one. Desktop layout looks fine, it is somehow responsive but the image is not taking full height when the screen-width changes. Mobile layout looks great though.

    Kirin already gave feedback on this, just going to add some suggestions as well:

    • It would be great to have a base styling with these properties
    html {
      box-sizing: border-box;
      font-size: 100%;
    }
    *,
    *::before,
    *::after {
      box-sizing: inherit;
    }
    

    This way, handling an element's size will be lot easier because of the box-sizing: border-box. You can search up some more of how this works.

    • On your body tag change the background-image: url(/images/bg-pattern-desktop.svg); to background-image: url(./images/bg-pattern-desktop.svg); using / or root path in github does not work.
    • Always have a main element to wrap the main content of your page. On this one, the .wrapper should be using the main instead of div.
    • Website-logo img should be using the website's name as the alt like alt="base apparel". Remember that a website's logo is meaningful so always make sure it uses the proper alt value.
    • h1 should be text-align: left and you don't need to use those span inside it to make each text wrap onto another row, you should just use max-width on the h1 and let the text wraps.
    • Your input tag lacks an associated label tag on it. Since there are visible-label, the label would be a screen-reader only label, meaning it would make user of like sr-only class. The text-content should describe what the input needs like the value on the placeholder.
    • error-icon is not showing, check for / path usage.
    • Now, the form error works but only limited for sighted users. A great way to make the input more accessible should be done like this:
    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. If you are confused on what said, have a look at this simple snippet that I made for accessible form you can always ask me if you have any questions about this one^^

    Aside from those, great work again on this one.

  • Ahmed•105
    @Kirin02
    Posted almost 4 years ago

    Hey, i'd say try to make the submit button hover animation a bit more interesting i would say, the position of the image is kinda odd i'd say espcially since it got sharp edges i would say move it to the extreme right or limit the height or something if you use inspect tool you'll find that it overflowing from the <body> Also It highly unrecommended to Use !important other than that i like the mobile display it looks really good but i think you can improve the desktop one a bit more

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