Frontend Mentor - Advice generator app solution

This is a solution to the Advice generator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Note: Delete this note and update the table of contents based on what sections you keep.

Overview

The challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Generate a new piece of advice by clicking the dice icon

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Mobile-first workflow
  • JS Native

What I learned

While making the style for the dice button I ran into a problem, where if the button is click and the pointer is on the dice image it would stay focus on the button thus making the focus style on even though it shouldn't. To fix this I use :focus-visiable instead of :focus for the selector.

Useful resources

  • Advice Slip JSON API - Of couse I have to give shoutout to the Advice Slip JSON API, wihout it this project won't even be possible.

Author