Setup Checklist in HTML, CSS and vanilla JS
A copy-paste Setup Checklist in plain HTML and CSS, with vanilla JavaScript: no framework, no build step, MIT-licensed.
Live preview
Source (copy-ready)
<section class="example-setup-checklist" data-dcl-layout="sequence" data-dcl-scheme="light" aria-labelledby="example-setup-checklist-title"><header><h2 id="example-setup-checklist-title">Setup Checklist</h2></header><div class="parts"><details name="example-setup-checklist-disclosures" open><summary>Create a workspace</summary><p>Choose a name teammates recognize.</p></details><details name="example-setup-checklist-disclosures"><summary>Invite your team</summary><p>Assign access one person at a time.</p></details><details name="example-setup-checklist-disclosures"><summary>Check permissions</summary><p>Review who can publish changes.</p></details></div>
<script>
(() => {
const root = document.currentScript.closest(".example-setup-checklist");
const instance = Array.from(document.getElementsByClassName("example-setup-checklist")).indexOf(root);
if (instance > 0) {
const references = ["id", "aria-labelledby", "aria-controls", "aria-describedby", "for", "name"];
for (const element of [root, ...root.querySelectorAll("*")]) {
for (const attr of references) {
if (element.hasAttribute(attr)) element.setAttribute(attr, element.getAttribute(attr) + "--" + instance);
}
const href = element.getAttribute("href");
if (href && href.startsWith("#")) element.setAttribute("href", href + "--" + instance);
}
}
const preference = matchMedia("(prefers-color-scheme: dark)");
const apply = () => { root.dataset.dclScheme = preference.matches ? "dark" : "light"; };
preference.addEventListener("change", apply);
apply();
})();
</script></section>
<style>
.example-setup-checklist { color: #11292f; background-color: #ffffff; color-scheme: light; }
.example-setup-checklist a { color: #005c62; }
.example-setup-checklist button, .example-setup-checklist summary, .example-setup-checklist input, .example-setup-checklist select {
color: #11292f; background-color: #e4edef; border-color: #697f84;
}
.example-setup-checklist button:hover, .example-setup-checklist summary:hover, .example-setup-checklist button[aria-selected="true"] {
color: #ffffff; background-color: #00535a;
}
.example-setup-checklist dialog { color: #11292f; background-color: #ffffff; }
.example-setup-checklist [data-note] { color: #11292f; background-color: #e4edef; }
.example-setup-checklist :focus-visible { outline: 3px solid #005c62; outline-offset: 2px; }
.example-setup-checklist[data-dcl-scheme="dark"] { color: #eff8f9; background-color: #142f36; color-scheme: dark; }
.example-setup-checklist[data-dcl-scheme="dark"] a { color: #8fe1da; }
.example-setup-checklist[data-dcl-scheme="dark"] button, .example-setup-checklist[data-dcl-scheme="dark"] summary, .example-setup-checklist[data-dcl-scheme="dark"] input, .example-setup-checklist[data-dcl-scheme="dark"] select {
color: #eff8f9; background-color: #1c3c44; border-color: #839fa5;
}
.example-setup-checklist[data-dcl-scheme="dark"] button:hover, .example-setup-checklist[data-dcl-scheme="dark"] summary:hover, .example-setup-checklist[data-dcl-scheme="dark"] button[aria-selected="true"] {
color: #11292f; background-color: #8fe1da;
}
.example-setup-checklist[data-dcl-scheme="dark"] dialog { color: #eff8f9; background-color: #142f36; }
.example-setup-checklist[data-dcl-scheme="dark"] [data-note] { color: #eff8f9; background-color: #1c3c44; }
.example-setup-checklist[data-dcl-scheme="dark"] :focus-visible { outline: 3px solid #8fe1da; outline-offset: 2px; }
.example-setup-checklist, .example-setup-checklist * { box-sizing: border-box; }
.example-setup-checklist { font: 1rem/1.5 system-ui, sans-serif; padding: 1rem; border-radius: 0.75rem; overflow-wrap: anywhere; }
.example-setup-checklist h2, .example-setup-checklist h3 { line-height: 1.15; margin-block: 0 0.75rem; }
.example-setup-checklist p { margin-block: 0.5rem; }
.example-setup-checklist ul { margin-block: 0.5rem; padding-inline-start: 1.5rem; }
.example-setup-checklist article, .example-setup-checklist details, .example-setup-checklist [data-note] { border: 1px solid; border-radius: 0.375rem; padding: 0.75rem; }
.example-setup-checklist button, .example-setup-checklist summary, .example-setup-checklist input, .example-setup-checklist select {
min-block-size: 44px; border: 1px solid; border-radius: 0.375rem; padding: 0.5rem 0.75rem; font: inherit;
}
.example-setup-checklist button, .example-setup-checklist summary { cursor: pointer; transition: background-color 140ms ease-out; }
.example-setup-checklist button:disabled { cursor: not-allowed; text-decoration: line-through; }
.example-setup-checklist input { display: block; inline-size: 100%; }
.example-setup-checklist dialog { max-inline-size: min(32rem, 90vw); border-radius: 0.75rem; padding: 1rem; }
.example-setup-checklist th, .example-setup-checklist td { padding: 0.5rem; text-align: start; border-block-end: 1px solid; }
.example-setup-checklist table { border-collapse: collapse; inline-size: 100%; }
.example-setup-checklist caption { font-weight: bold; text-align: start; }
.example-setup-checklist dt { font-weight: 600; }
.example-setup-checklist dd { margin: 0 0 0.75rem; }
.example-setup-checklist [hidden] { display: none !important; }
.example-setup-checklist .parts { display: grid; gap: 0.75rem; border-inline-start: 0.25rem solid; padding-inline-start: 1rem; }
@media (max-width: 30rem) {
.example-setup-checklist[data-dcl-layout="rail"] .parts { grid-template-columns: minmax(0, 1fr); }
.example-setup-checklist[data-dcl-layout="rail"] .parts > :is(p, ul, article) { grid-column: 1; grid-row: auto; }
.example-setup-checklist[data-dcl-layout="rail"] .parts > :is(details, nav) { grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) { .example-setup-checklist * { transition: none !important; } }
</style>
When to use
Use this sequence when items have a natural reading order.
Avoid
Keep critical information visible rather than requiring a disclosure.
Accessibility
Keep each summary descriptive so native Enter and Space activation are useful.
Was this useful? Send feedback.