@fatemzh
Posted
Congrats for making it visually identical ! Your code is well-structured with good practices. You could improve it by using <div> over <section> for better clarity. Also to improve accessibility you could use role="alert". This is a simple project with only one page, maybe having a more synthetic css structure would make the code easier to maintain and more efficient.
@fatemzh What do you mean by having a more synthetic CSS structure? And why is <div>
better than <section>
?
@fatemzh
Posted
@moadavou I considered this from the perspective of a colleague who might need to modify the project in the future. The current folder and file structure, while thorough, is quite complex for a simple single-page project. This level of organization might make it more challenging to quickly find and change something, which could be streamlined for easier maintenance. My apologies for the confusion regarding the use of <div> versus <section>. I see now that I got confused with another project code, so my feedback on that wasn't relevant sorry!
@fatemzh I'm afraid that wouldn't improve accessibility. It would actually make it a little worse because the error and input would no longer be programmatically linked.
An improvement would be changing the aria-live value to "assertive" but not role to "alert".
Marked as helpful
@fatemzh I understand your perspective. But my goal with these smaller projects is to practice, not for anyone else to modify. If it were a bigger project the level of organization would be beneficial. I chose to practice organizing my files as if this were a bigger project.
@fatemzh
Posted
@moadavou Indeed, it totally makes sense. Where did you find ressources on building that type of more advanced folder structures ? Is the one you did a standard ?
@fatemzh
Posted
@grace-snow Oh ok good to know, I was taught differently. There are so many nuances, it gets a bit confusing. Thanks for the clarification 😊. Do you have examples in which it's more suitable to use the "alert" role ?
@fatemzh I rarely ever use it to be honest but it would be suitable for an error block at the top of a form (one that lists all the errors).