Design comparison
Solution retrospective
When using :active :hover and :focus states, what's your method for maintaining accessibility while keeping the design clean? Whenever :focus is activated, it remains until you click outside the element. How do you prevent that?
What is your method for file organization? I'm used to having a src folder, but the index has to be in the root for most hosting sites.
Community feedback
- @elidrissidevPosted over 2 years ago
Hey Sara π,
Congrats on finishing your first challenge!
To address your questions:
- There is a workaround to the focus issue, and it's the
:focus-visible
pseudo-class, quote from MDN docs: The :focus-visible pseudo-class applies while an element matches the :focus pseudo-class and the UA (User Agent) determines via heuristics that the focus should be made evident on the element. (Many browsers show a "focus ring" by default in this case.)
But keep in mind that this is not supported in Safari, so you'd want to have a fallback style using the regular
:focus
as mentioned in the link.- For code organizations, I usually use a bundler such as Parcel, that way I can organize my files under
src
folder and also get to use modern javascript features. When ready to deploy, Parcel compiles everything together under adist
folder by default which you can configure to be the root folder used when deploying to a service (I know vercel and netlify have it, not very sure about github pages).
I hope this answers your questions, feel free to ask if you have more and good luck!
0 - There is a workaround to the focus issue, and it's the
Please log in to post a comment
Log in with GitHubJoin 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