Themes

A theme is one stylesheet that decides how every component looks. The markup and canon.js don't change, so a page moves to another theme by changing one line.

One markup, six themes

Each frame below holds the same HTML, and they all work. Only the linked stylesheet differs. To read these docs in a theme, use its button or the menu in the top bar.

The themes other than Canon are inspired by the Carbon, Material, Fluent, Ant Design and Bootstrap design systems. They aren't affiliated with or endorsed by IBM, Google, Microsoft, Ant Group or the Bootstrap project. Those names are trademarks of their owners.

Use a theme

Link the theme's stylesheet in place of css/canon/canon.css. Each theme is a folder in css/, so keep its files together:

index.html
<link rel="stylesheet" href="css/carbon/carbon.css">
The themes and what each brings
ThemeStylesheetTypeIcons
Canoncss/canon/canon.cssInter, JetBrains MonoLucide
Carbon-inspiredcss/carbon/carbon.cssIBM Plex Sans and Mono, in the folderCarbon icons, in the folder
Material-inspiredcss/material/material.cssRoboto and Roboto Mono, in the folderMaterial Symbols, in the folder
Fluent-inspiredcss/fluent/fluent.cssSegoe UI where it's installed, otherwise the system fontFluent UI System Icons, in the folder
Ant Design-inspiredcss/ant/ant.cssThe system fontAnt Design Icons, in the folder
Bootstrap-inspiredcss/bootstrap/bootstrap.cssThe system fontBootstrap Icons, in the folder

Write your own

The quickest way is to build on canon.css, as every other theme here does. Change the tokens first, since they restyle every component at once, then add rules for what makes the look its own:

acme.css
/* css/acme/acme.css */
@import url("../canon/canon.css");

@layer canon.theme {
  :root {
    /* Tokens restyle every component at once… */
    --canon-theme-font-mono: "Acme Mono", monospace;
  }

  /* …then rules redraw what makes the look its own. */
  .canon-button { border-radius: 0; }
}

To start from nothing, import css/canon/canon.core.css instead and draw every component yourself. Each component's specification lists what a theme must do, and the contract check shows markup that breaks a component's contract while you build.

For a few changes, you don't need a theme. Canon's styles sit in cascade layers, so your own unlayered CSS always wins.