A box with a title bar
Any content goes in the body.
A nested box, with only a label in its title bar
Nested boxes suit replies, sub-items or cards inside a larger box.
My styles. Version 1.0.0.
Pure CSS. Designed for plain, semantic HTML with some modifier classes.
Link the stylesheet:
<link rel="stylesheet" href="https://ui.blaix.com/v1/styles.css">
That URL always serves the latest 1.x release. See versions to pin an exact one.
Pages are full-width with a header, body, and footer.
The body can be single-column, or two-column with .sidebar-layout.
| Selector | Role |
|---|---|
body > header |
Top header bar of the site.
Typically holds a title (h1),
an optional tagline (p) and an optional nav.
|
body > header nav |
A list of links, shown as tabs along the bottom of the header |
[aria-current="page"] |
Marks the active tab |
body > main |
Body band, one column |
.sidebar-layout |
Wrap a main and an
aside wit this for a two-column layout.
They stack on narrow screens. See
sidebar.
|
.grid |
Equal-width columns that wrap to fit. See grids of boxes. |
body > footer |
Footer at the bottom of the site.
Typically with a p and a
ul.inline.
|
<body>
<header>
<h1><a href="/">Site title</a></h1>
<p>Tagline</p>
<nav>
<ul>
<li><a href="/" aria-current="page">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
</header>
<main>
…
</main>
<footer>
<p>Footer text</p>
</footer>
</body>
<body>
<header>…</header>
<div class="sidebar-layout">
<main>…</main>
<aside>…</aside>
</div>
<footer>…</footer>
</body>
A main next to an aside
The main column
<div class="sidebar-layout">
<main>…</main>
<aside>
<section class="box">
<header><h3>Links</h3></header>
<ul>
<li><a href="…">First link</a></li>
…
</ul>
</section>
<section class="box">
<header><h3>Search</h3></header>
<form role="search">
<input type="search" aria-label="Search">
<button>Go</button>
</form>
</section>
<div class="box">
<p>A box with no title bar.</p>
</div>
<p><span class="badge">Not boxed</span></p>
</aside>
</div>
.box is a bordered container.
A header directly inside it becomes a title bar,
and a footer becomes a footer bar.
Both are optional.
Any content goes in the body.
A nested box, with only a label in its title bar
Nested boxes suit replies, sub-items or cards inside a larger box.
A box with no header or footer is a padded box.
<article class="box">
<header>
<p><time datetime="2026-11-14">November 14, 2026</time></p>
<h3>A box with a title bar</h3>
</header>
<p>Any content goes in the body.</p>
<article class="box">
<header>
<p>A nested box, with only a label in its title bar</p>
</header>
<p>Nested boxes suit replies, sub-items or cards inside a larger box.</p>
</article>
<footer>
<p>The footer bar, for metadata, actions or links</p>
</footer>
</article>
<div class="box">
<p>A box with no header or footer is a padded box.</p>
</div>
.grid
.grid lays its children out in equal columns,
each at least --grid-min wide, wrapping onto new rows as needed.
Boxes in a grid stretch to the same height,
and their footer bars stay at the bottom.
Pair it with .large for rows of figures.
Visitors
1,284
Signups
37
Open issues
5
<div class="grid">
<section class="box">
<header><p>Visitors</p></header>
<p class="large">1,284</p>
<footer><p>Today</p></footer>
</section>
…
</div>
| Element | Example | Use it for |
|---|---|---|
<a> |
A link | Links. Visited links get their own color. |
<strong> |
Strong | Importance |
<em> |
Emphasis | Stress |
<code> |
code |
Code fragments |
<kbd> |
Ctrl + S | Keyboard input |
<mark> |
Marked | Highlights |
<abbr> |
CSS | Abbreviations, with a title |
<del> / <ins> |
Edits and corrections | |
<sub> / <sup> |
H2O, x2 | Subscript and superscript |
<small> |
Small print | Side comments, fine print |
<time> |
Dates, with a datetime |
Above the rule.
Below the rule.
<hr>
<ul>
<li>Unordered item</li>
<li>Another item
<ul><li>Nested item</li></ul>
</li>
</ul>
<ol>
<li>First</li>
<li>Second</li>
</ol>
<dl>
<dt>Term</dt>
<dd>Definition of the term.</dd>
</dl>
Why do they call it oven when you of in the cold food of out hot eat the food.
<figure> with a caption.<blockquote>
<p>View source is the best teacher the web ever had.</p>
<footer>— <cite>Every self-taught web developer</cite></footer>
</blockquote>
<figure>
<img src="photo.svg" alt="A sunset over hills">
<figcaption>A <figure> with a caption.</figcaption>
</figure>
Wrap inline code in <code>.
Wrap blocks of code in <pre><code>.
<pre><code>main =
Node.defineSimpleProgram init</code></pre>
| Album | Year | Standout track |
|---|---|---|
| Kiss | 2012 | Tonight I'm Getting Over You |
| Emotion | 2015 | Favourite Colour (bonus track) |
| Dedicated | 2019 | Too Much |
| The Loneliest Time | 2022 | Surrender My Heart |
| Day and Night | 2026 | Motivation |
<table>
<caption>This is a table caption</caption>
<thead>
<tr><th>Album</th><th>Year</th><th>Standout track</th></tr>
</thead>
<tbody>
<tr><td>Kiss</td><td>2012</td><td>Tonight I'm Getting Over You</td></tr>
…
</tbody>
</table>
Add .note, .alert or .success to a container
to set it apart from the text around it.
Note: For asides, tips and information.
Alert: For warnings, errors and corrections.
Success: For confirmations and things that went right.
<div class="note">
<p><strong>Note:</strong> For asides, tips and information.</p>
</div>
<div class="alert">…</div>
<div class="success">…</div>
Collapsible content uses <details>.
Hidden until the summary is clicked.
<details>
<summary>Show me more</summary>
<p>Hidden until the summary is clicked.</p>
</details>
Put each label and its control in a <p>.
Wrapping a checkbox or radio inside its <label> lays it out inline.
<form>
<fieldset>
<legend>A fieldset</legend>
<p>
<label for="text">Text</label>
<input id="text" type="text">
</p>
<p>
<label><input type="checkbox"> Checkbox</label>
</p>
<p><button type="submit">Submit</button></p>
</fieldset>
</form>
<button> is styled by default.
Add .button to a link to make it look like one,
and .secondary for a less prominent action.
<button>Button</button>
<button class="secondary">Secondary</button>
<a href="…" class="button">Link</a>
<a href="…" class="button secondary">Secondary link</a>
<button disabled>Disabled</button>
<progress> shows how far along a task is.
<meter> shows a measurement in a known range.
A meter is green, orange or red,
depending on where its value falls
against its low, high and optimum attributes.
Both are full-width bars, up to 20em.
Progress
Meter, good
Meter, warning
Meter, bad
<progress max="100" value="64">64%</progress>
<!-- optimum="0": lower is better, so 80 is a warning and 95 is bad -->
<meter min="0" max="100" low="70" high="90" optimum="0" value="80">80%</meter>
.badge makes a small label.
Add .note, .alert or .success to color one,
for example to show a status.
.tag is for keywords and categories.
<a href="…" class="badge">RSS</a>
<span class="badge">New</span>
<span class="badge note">Paused</span>
<span class="badge alert">Failed</span>
<span class="badge success">Up</span>
<a href="…" class="tag">css</a>
Utilities each do one thing and work on any element.
| Class | Effect | Example |
|---|---|---|
.muted |
Low-contrast text | Muted text |
.small |
Smaller text | Small text |
.large |
Larger text, for headline figures | 42 |
.caps |
Small caps or uppercase, depending on the theme | Caps text |
.center |
Centered text | (see below) |
.float-left |
Float left, with a gap for text to wrap | (see below) |
.float-right |
Float right, with a gap for text to wrap | (see below) |
.inline |
Puts a list on one line with separators | (see below) |
This avatar has .float-left, so this paragraph wraps around it.
Here's some more words so we can see it wrapping.
I know things are getting tough when you can't get the top off the bottom of the barrel.
All I know is that I don't know nothing.
And that's fine.
<img src="avatar.svg" alt="" class="float-left">
<p class="center">A .center paragraph.</p>
<ul class="inline">
<li><a href="/">Home</a></li>
<li><a href="/docs">Docs</a></li>
<li><a href="/about">About</a></li>
</ul>
The theme is a set of custom properties on :root.
| Token | Swatch | Used for |
|---|---|---|
--color-bg |
Page background | |
--color-panel |
Box, header band and input backgrounds | |
--color-text |
Body text | |
--color-text-soft |
Quotes, labels, badge text | |
--color-muted |
Dates, captions, secondary text | |
--color-title |
Site title in the header | |
--color-link |
Links | |
--color-visited |
Visited links | |
--color-hover |
Hovered links | |
--color-accent |
h2 headings |
|
--color-primary |
Progress bars, quote borders, focus rings, checkboxes | |
--color-primary-dark |
h3 headings |
|
--color-info |
.note callouts and badges |
|
--color-alert-edge |
.alert callout border |
|
--color-warning |
.alert badges, middling meters |
|
--color-success |
.success callouts and badges, good meters |
|
--color-danger |
Bad meters | |
--color-edge |
Edges of boxes, tables, fieldsets and buttons | |
--color-border |
Inner borders: table cells, figures, footer bars, rules | |
--color-border-strong |
Input, button and badge borders | |
--color-rule |
Separators inside lists | |
--color-tint |
Footer bars, code, subtle backgrounds | |
--color-field |
Inputs, tables, code and meter tracks | |
--color-button-top |
Top of the button gradient, and the hover color | |
--bar-text |
Headings in title bars | |
--bar-text-nested |
Headings in nested box title bars | |
--bar-meta |
Other text in title bars, such as dates | |
--color-footer-bar |
Box footer bars | |
--color-table-head |
Table header row | |
--color-stripe |
Alternate table rows | |
--color-mark |
<mark> highlight |
|
--color-note |
.note background |
|
--color-alert |
.alert background |
|
--color-success-bg |
.success background |
| Token | Used for |
|---|---|
--font-body | Body text |
--font-heading |
Headings. Defaults to --font-body. |
--font-ui |
Small interface text: buttons, tabs, captions, bars |
--font-mono | Code |
--text-size | Base font size |
--leading | Base line height |
--heading-weight | Heading weight |
--heading-style |
Heading style, e.g. italic |
| Token | Used for |
|---|---|
--label-font |
Font for labels: sidebar box titles, table headers, legends, small
headings, the tagline and .caps
|
--label-weight | Label weight |
--label-style |
Label style, e.g. italic |
--label-variant |
Label variant, e.g. small-caps |
--label-transform |
Label case, e.g. uppercase |
--label-spacing |
Label letter spacing |
--label-scale |
Multiplier for label sizes, to balance different fonts and cases |
--marker |
Marker before aside list items |
--separator |
Separator between .inline list items |
--rule-style |
Line style for hr and list separators:
dotted, dashed or solid
|
| Token | Used for |
|---|---|
--page-width |
Maximum width of the content inside the full-width header, body and footer bands |
--page-pad |
Minimum space between content and the window edge |
--sidebar-width |
Width of the aside column |
--gap |
Space between main and aside |
--grid-min |
Minimum column width in a .grid |
--box-pad | Padding inside boxes |
--radius | Corner radius |
--bar-gradient |
Title bar background |
--bar-gradient-nested |
Title bar background in nested boxes |
:root {
--color-accent: #c33;
--font-body: Verdana, "DejaVu Sans", sans-serif;
}
Tokens can also be set on one page or one element.
For example, widen a single page with <html style="--page-width: 74rem">.
The stylesheet follows semantic versioning. The current version is 1.0.0; see the releases directory for every available version. Each release is published at these URLs:
| URL | Description | Latest |
|---|---|---|
/vX/styles.css |
The latest X.y.z release. | /v1/styles.css |
/vX.Y.Z/styles.css |
Exact pinned version X.Y.Z. | /v1.0.0/styles.css |
/latest/styles.css |
The latest (released or unreleased) stylesheet, as of the last deploy. | /latest/styles.css |
Exact-version files are cached for a year and never change.
Major-version URLs are cached for an hour.
/latest/ is revalidated on every request.
All three send Access-Control-Allow-Origin: *.