Follow up to #1057. I realized that the main page container that I added for page_sidebar() and page_navbar(sidebar=sidebar()) is something we will likely want to use in other contexts, ex. in page_navbar() without a sidebar, or in page_fillable() or in a theoretical page_dashboard() with/without a sidebar.
This PR updates the approach to be more generic:
Creates main.bslib-page-main for the container (instead of .bslib-page-sidebar-main)
Uses .bslib-page-main as the CSS class (instead of .bslib-page-sidebar-main)
bslib-page-main-min-{width,height} for the Sass/CSS variables (instead of bslib-page-sidebar-main-min-{width,height}).
The most controversial decision is switching from <div> to <main>. I think this is the right approach because the intent is to wrap the main content area and these PRs reveal that we know which container is the page's main container. I feel strongly that we should be adding a <main> landmark. But the downside is that there should only be one <main> tag on the page at a time, meaning we're making the decision for the user.
That said, it's very unlikely that a user is going to add a <main> landmark on their own and those who know about the need are also likely to use accessibility scanning tools which will surface our <main>.
Follow up to #1057. I realized that the main page container that I added for
page_sidebar()
andpage_navbar(sidebar=sidebar())
is something we will likely want to use in other contexts, ex. inpage_navbar()
without a sidebar, or inpage_fillable()
or in a theoreticalpage_dashboard()
with/without a sidebar.This PR updates the approach to be more generic:
main.bslib-page-main
for the container (instead of.bslib-page-sidebar-main
).bslib-page-main
as the CSS class (instead of.bslib-page-sidebar-main
)bslib-page-main-min-{width,height}
for the Sass/CSS variables (instead ofbslib-page-sidebar-main-min-{width,height}
).The most controversial decision is switching from
<div>
to<main>
. I think this is the right approach because the intent is to wrap the main content area and these PRs reveal that we know which container is the page's main container. I feel strongly that we should be adding a<main>
landmark. But the downside is that there should only be one<main>
tag on the page at a time, meaning we're making the decision for the user.That said, it's very unlikely that a user is going to add a
<main>
landmark on their own and those who know about the need are also likely to use accessibility scanning tools which will surface our<main>
.