Does this really pass the accessibility/semantic HTML "sniff test", though? Dumping all body content inside main as implied by id="app" suggests that everything is main content. If everything is main, then nothing is main.
I sometimes start off a project like this (or more often with something like div#app>(header>nav#site-nav)+main#container>{...everything else}), but usually after a while I still find I've placed main too far up the tree and it ends up holding stuff like secondary navigation, sidebars, or site footers, which isn't semantically correct. At that point it's time for a refactor.
Adjust accordingly then. Which it seems you have. No, not everything needs to be in <main> but it would be nice to have main content in the main container. Also, as I stated in the article, "I get that there are cases where it is a<div>and what I am saying is moot." so I know there are many cases where it may not be applicable, but if it is, use it is what I am saying.
I'm Calin Baenen – AKA KattyTheEnby – a programmer born October 30th, 2006.
I love programming, it has been my passion since I was a kid, and will forever be my passion.
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
11 plus years* active enterprise development experience and a Fine art degree 🎨
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
11 plus years* active enterprise development experience and a Fine art degree 🎨
Thank you, Salma! 😊🤣
Nice article, always good to be cognizant of these things!
Does this really pass the accessibility/semantic HTML "sniff test", though? Dumping all body content inside
mainas implied byid="app"suggests that everything is main content. If everything is main, then nothing is main.I sometimes start off a project like this (or more often with something like
div#app>(header>nav#site-nav)+main#container>{...everything else}), but usually after a while I still find I've placedmaintoo far up the tree and it ends up holding stuff like secondary navigation, sidebars, or site footers, which isn't semantically correct. At that point it's time for a refactor.Adjust accordingly then. Which it seems you have. No, not everything needs to be in
<main>but it would be nice to have main content in the main container. Also, as I stated in the article, "I get that there are cases where it is a<div>and what I am saying is moot." so I know there are many cases where it may not be applicable, but if it is, use it is what I am saying.I forgot is exist 😂
It's always good to have a reminder. I sometimes forget about certain things while coding myself!
Check my website — it's been like this since 1.0.0. 😎
Nicely done!
I do?
If you want to make your stuff more accessible, yes. If not, then you don't have to. Your mileage may vary.
no, I mean I do!
😂 Heck yeah!