This demo shows different designed affordances
at different screen sizes (view the source too)…
It uses a programatic API to set the current affordances
element.setActiveAffordance('collapse' /* or 'tab-bar' or 'exclusive-collapse' */)
The tab-bar
affordance
can use shadow-dom to establish
a styleable tab-bar and panels.
The required parts can be exposed for styling
with consistent pseudo-elements.
In a tab state, we likely want to style:
The accordion-like collapse
affordance
also uses shadow-dom to establish
summary-details like behavior for each section,
with an option to make the toggle-states
exclusive-collapse
.
In an accordion state, we likely want to style:
The fallback state is simply structured HTML, without any show/hide affordances. This does not require any special styling.
Test link 3