Plain HTML + CSS
Step-by-step tutorial for static sites: download tokens, link CSS, set data-atelier-* on <html>, copy markup, and optionally add atelier-plain.js for theme/mode buttons. React copy remains the full component path.
1. Download the bundle
Unzip into your site's static folder (e.g. public/ or next to index.html). You need tokens.css and atelier-plain.css; atelier-plain.js is optional (step 5).
2. Link CSS in your page
In <head>, load tokens first, then primitives. Adjust paths if your files live in a subfolder.
<link rel="stylesheet" href="./tokens.css" />
<link rel="stylesheet" href="./atelier-plain.css" />3. Set theme & mode on <html>
Variables from tokens.css apply on the element that has both attributes — usually <html>. Selector: [data-atelier-theme="atelier"][data-atelier-mode="light"].
<html lang="en" data-atelier-theme="atelier" data-atelier-mode="light">
...
</html>4. Add HTML + .atelier-* classes
Put class="atelier-root" on body. Use primitives from atelier-plain.css. Per-component snippets live on Install → Plain HTML + CSS when available.
5. JavaScript tutorial (optional toggles)
Skip this if a fixed theme is enough. Otherwise use atelier-plain.js to update data-atelier-theme and data-atelier-mode when visitors click buttons.
- Include the script. After unzipping, put
atelier-plain.jsbesidetokens.cssandatelier-plain.css. Add to<head>:The script does not run by itself — you call<script src="./atelier-plain.js" defer></script>AtelierPlain.init()below. - Set a starting theme on
<html>(or passtheme/modetoinit()). Example:<html data-atelier-theme="atelier" data-atelier-mode="light"> - Add toggle buttons with catalog theme ids and/or mode. Use
.atelier-btnclasses so they match your page:<!-- Pick a catalog theme id (same as React theme="…") --> <button type="button" class="atelier-btn atelier-btn--secondary" data-atelier-set-theme="zinc-folio"> Zinc folio </button> <!-- Theme + mode in one click --> <button type="button" class="atelier-btn atelier-btn--secondary" data-atelier-set-theme="atelier" data-atelier-set-mode="dark" > Atelier dark </button> <!-- Mode only — keeps the current theme --> <button type="button" class="atelier-btn atelier-btn--ghost" data-atelier-set-mode="light">Light</button> <button type="button" class="atelier-btn atelier-btn--ghost" data-atelier-set-mode="dark">Dark</button> - Initialize on
DOMContentLoaded.bindControls()wires everydata-atelier-set-*button in the document.persist: truesaves the choice inlocalStorage(AtelierPlain.storageKey):document.addEventListener("DOMContentLoaded", function () { // Apply theme/mode on <html> (reads attributes, optional localStorage) AtelierPlain.init({ persist: true }); // Click handlers for [data-atelier-set-theme] and [data-atelier-set-mode] AtelierPlain.bindControls({ persist: true }); }); // Imperative alternative (no buttons): // AtelierPlain.apply("magenta-edit", "dark", { persist: true }); - Try it. Buttons below use the same script as a static site (loaded from this docs server). Click a theme or mode — tokens on the panel should update.
Try the controls — same
data-atelier-set-*hooks as a static page. - Copy a full page. Paths assume files sit in the same folder as
index.html.<!DOCTYPE html> <html lang="en" data-atelier-theme="atelier" data-atelier-mode="light"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="./tokens.css" /> <link rel="stylesheet" href="./atelier-plain.css" /> <script src="./atelier-plain.js" defer></script> </head> <body class="atelier-root"> <button type="button" class="atelier-btn atelier-btn--secondary" data-atelier-set-theme="zinc-folio"> Zinc folio </button> <button type="button" class="atelier-btn atelier-btn--ghost" data-atelier-set-mode="dark">Dark</button> <button type="button" class="atelier-btn atelier-btn--primary">Hello</button> <script> document.addEventListener("DOMContentLoaded", function () { AtelierPlain.init({ persist: true }); AtelierPlain.bindControls({ persist: true }); }); </script> </body> </html>