MicroDOM ecosystem
Stable v1.0.0 Classless Opt-in scope

Mode CSS [µ*]

A classless, cascade-first CSS layer. Style semantic HTML directly — minimal selectors [µ*], no utility-class soup, a small and reusable footprint. No build. Just minify

Because to get a real micro DOM you need a micro CSS too.

Install ✨Demo Docs View on GitHub

Goals

Semantic HTML

Style elements, not components. Your markup stays meaningful.

Minimal classes

Reach for a class only when the cascade genuinely can't.

No utility soup

No endless utility classes cluttering your markup.

Highly reusable

One calm, neutral baseline you carry between projects.

Small footprint

11.6 KB minified, 3.1 KB gzip — and it earns every rule it ships.

DOM-first

The design baseline for the content web — typography, layout and components that semantic HTML already deserves.

How it works

This very page is built with Mode CSS. The layout, header, navigation, cards, forms and footer you are looking at come straight from the base stylesheet — semantic HTML plus a few µ-attributes. Only the colors and a few decorative touches live in a separate theme file.

The CDN is for prototyping; npm is for shipping.

page.html

<link rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/@microdom/mode.css@1/dist/mode.min.css">

terminal

npm install @microdom/mode.css

app.js

import "@microdom/mode.css";      // flat, readable build
import "@microdom/mode.css/min";  // minified build

page.html

<link rel="stylesheet" href="mode.css">    <!-- base layout + defaults -->
<link rel="stylesheet" href="custom.css">  <!-- your theme -->

Write plain, semantic markup. The cascade does the styling — no class on every element.

page.html

<main>
  <section µ-grid="3-col">
    <article>
      <h3>Readable by default</h3>
      <p>Just semantic HTML — no classes.</p>
    </article>
    <!-- ... More Articles -->
  </section>
</main>

The attribute vocabulary

Layout that the cascade can't express alone is opted into with an exact set of µ-attributes — no class soup, just intent.

AttributeWhat it does
µ-gridAuto-responsive grid (auto-fit, min 280px).
µ-grid="2-col … 6-col"Explicit column counts at each breakpoint.
µ-grid="sidebar-left"Asymmetric sidebar + content layout.
µ-grid > articleBecomes a native card automatically.
µ-pricing   µ-grid="3-col blog"Themed section variant defined in your theme file.

Tokens are the theme

The base ships a small set of design tokens — typography scale, spacing rhythm, a neutral palette and the master layout widths. Re-skinning the whole site is mostly a matter of overriding them in custom.css.

custom.css

:root {
  --color-bg:     #0b0d12;   /* dark steel */
  --color-text:   #d8dee8;
  --color-accent: #ff7a18;   /* molten ember */
  --radius:       12px;
  --max-width:    1080px;
}

What Mode CSS is not

Mode.js + Mode CSS = intent-aligned. Micro DOM behavior, micro visual semantics — one standard, two layers.

Classes are state

Classes are state, not decoration. Static design lives in the cascade — zero classes. State lives first in native attributes (disabled, aria-*, :checked). A class is the marker of last resort: a circumstance no native tag can express — a price turning neg, a row going stale. That's why Mode markup stays clean: every class you do see means something is happening right now.

live-table.html

<td>$41,203</td>          <!-- steady: no class -->
<td class="neg">$40,981</td>  <!-- dropped: the one class that means something -->

Why classless pays off

Semantic, classless HTML ships fewer bytes; fewer bytes render faster and read cleaner. A document expressed in native elements and native state is more accessible to assistive technology, clearer to search engines, and easier for the AI readers of the web to parse — the meaning is in the tags, not in a decoration layer they have to decode.

Stable v1.0.0
Read the docs → Explore the ecosystem Pair it with Mode.js