v0.5.0 · ~11kb gzipped

Mates CSS

We don't flash, we deliver!

Compact CSS UI kit — blue primary, tokens, auto dark mode. Overlays open when you add .open (the demo script below is only a preview).

Buttons

As a link
Click and release — a CSS ripple from the center (no JS).

Tags

Default Primary Success Warning Danger Soft Soft success Soft danger Rounded Removable

Forms

Hint text under inputs.
Only letters and numbers allowed.
Looks good.
https://

Cards

Card title

With subtitle

Shadow deepens on hover. No JS, no jumping.

Badges inside

active failed draft

Table & tabs

PlanPriceStatus
Free$0active
Pro$20selected
Team$75draft

Charts

Pure CSS charts — data lives in inline custom properties: --v (0–100) for bars, rings and sparklines, --v1…--v6 for donut segments, --sv for stacked shares.

Weekly sales

.chart-bars / .bar · value via --v

Traffic sources

.donut + .legend · segments via --v1…--v6

Organic Paid Referral Social

Revenue by quarter

.bar.stacked · shares via --sv, total via --v

Direct Online Retail

Skill match

.chart-hbars / .hbar

Last 14 days

Alerts & toasts

Neutral alert with a left accent bar.
Done. Changes saved.
Careful. Cannot be undone.
Error. Please retry.

Toast

Neutral dark toast.

Primary

Brand colored.

Success

Saved.

Tooltips, modal, accordion

Accordion item one

Expand/collapse with native details — no JS.

Accordion item two

Another panel.

Menu, popover, drawer, sheet

Add .open on .pop from a click handler.

Bottom sheet

Toggle .open on .sheet.

  1. Account
  2. Plan
  3. Pay
  1. Account
  2. Plan
  3. Pay

Feedback extras

Skeleton

Empty + spinner

No projects

Create one to get started.

Status + badge

Online

Away

Busy

Lists, timeline, stats

Shipped 0.5

New overlays and shell.

Charts

Bars, donut, spark.

Revenue$24k+12%
Churn2.1%-0.4%
Plan
Pro
Seats
8
Region
eu-west

Form extras

Profile
@
Shown on your public profile.
Always on

Shell, split

App shell

Toggle .collapsed on .shell to shrink the side.

Pane A · --split
Pane B

Flex & grid

col
col
col
auto
auto
auto
auto
span 1
m-col-span-2
m-justify-between with m-gap-sm
M

m-flex-1 filler

text takes remaining space

Layout — m-row / m-col / flex & grid

m-row / m-col are directional flex containers; children share space equally.

auto
auto
auto
c-4
c-8
m-j-between m-i-center m-gap-10
auto-fit
auto-fit
auto-fit
1
2
3

Spacing utilities

m-b-10 margin-bottom: 10px

p-10 padding: 10px

m-t-5 + p-x-5 on this line

Misc

Inbox 12 · Alerts 3 · New 1

divider
AL SM LG AL SM LG
c-4
c-8

More patterns

brief.pdf128 KB
logo.svg4 KB
Plan
Pro
Seats
8
Region
eu-west

New API

v0.5 ships overlay .open.

Paid

Invoice #1042

Failed

Card was declined.

Can you ship the kit today?Ada · 4:02
Yes — CSS only.You · 4:03
The best UI kit is the one you can paste into any stack.
Sean Freeman
16×9 figure with caption
Mates CSSmates-js.dev

Typography

h1

The quick brown fox

h2

The quick brown fox

h3

The quick brown fox

h4

The quick brown fox

h5

The quick brown fox

h6

The quick brown fox

p

Body copy at 16px. Mates styles native tags first — this is a plain paragraph with a link inside.

small

Small print sits at body size with muted color.

a

Inline link to buttons

hr


blockquote

A pull quote. Native blockquote — no class.

ul

ol

  1. First step
  2. Second step
  3. Third step

kbd

Ctrl K

.kbd-row

⌘K

mark

Highlight this phrase in a sentence.

code

import "mates-css"

pre

npm install mates-css

dl

Plan
Pro
Seats
8

.overline

Section label

.muted

Secondary body color.

.subtle

Tertiary / hint color.

.mono

0123456789 --m-fs

.text-sm

Small utility text.

.text-lg

Large utility text.

.fw-500

Medium weight.

.fw-700

Bold weight.

.tabular

$1,240.00   $98.50   $12,004.00

.truncate

This line is clipped with an ellipsis when it overflows the box.

.clamp-2

Two-line clamp. Extra words wrap once, then the rest is cut off so the block never grows past two lines of copy in the demo.

.clamp-3

Three-line clamp. This paragraph is long enough to wrap past three lines so you can see the clamp take effect on the last visible line with an ellipsis at the end of the block.

.center

Centered line.

.prose

Reading width

Use .prose on an article for a comfortable measure. Headings and paragraphs inside pick up a bit more vertical rhythm.

Utility map

Reusable layout and spacing classes — not components. Class on the left, CSS on the right.

Display & flex

ClassCSS
.m-flexdisplay: flex
.m-inline-flexdisplay: inline-flex
.m-flex-rowflex-direction: row
.m-flex-colflex-direction: column
.m-flex-wrapflex-wrap: wrap
.m-flex-nowrapflex-wrap: nowrap
.m-flex-1flex: 1 1 0%; min-width: 0
.m-flex-autoflex: 1 1 auto
.m-flex-noneflex: none
.m-growflex-grow: 1
.m-shrink-0flex-shrink: 0
.m-basis-0flex-basis: 0
.m-order-firstorder: -1
.m-order-lastorder: 99

Align & justify

Short aliases: .m-i-* = .m-items-*, .m-j-* = .m-justify-*.

ClassCSS
.m-items-start / .m-i-startalign-items: flex-start
.m-items-center / .m-i-centeralign-items: center
.m-items-end / .m-i-endalign-items: flex-end
.m-items-stretch / .m-i-stretchalign-items: stretch
.m-items-baseline / .m-i-baselinealign-items: baseline
.m-self-startalign-self: flex-start
.m-self-centeralign-self: center
.m-self-endalign-self: flex-end
.m-justify-start / .m-j-startjustify-content: flex-start
.m-justify-center / .m-j-centerjustify-content: center
.m-justify-end / .m-j-endjustify-content: flex-end
.m-justify-between / .m-j-betweenjustify-content: space-between
.m-justify-around / .m-j-aroundjustify-content: space-around
.m-justify-evenly / .m-j-evenlyjustify-content: space-evenly
.m-j-center-vjustify-content: center
.m-content-startalign-content: flex-start
.m-content-centeralign-content: center
.m-content-betweenalign-content: space-between

Grid

.m-grid-cols-2|3|4 collapse to one column under 640px.

ClassCSS
.m-griddisplay: grid
.m-inline-griddisplay: inline-grid
.m-grid-cols-2grid-template-columns: repeat(2, minmax(0, 1fr))
.m-grid-cols-3grid-template-columns: repeat(3, minmax(0, 1fr))
.m-grid-cols-4grid-template-columns: repeat(4, minmax(0, 1fr))
.m-grid-cols-autogrid-template-columns: repeat(auto-fit, minmax(16rem, 1fr))
.m-grid-cols-auto-smrepeat(auto-fit, minmax(11rem, 1fr))
.m-grid-cols-auto-lgrepeat(auto-fit, minmax(22rem, 1fr))
.m-grid-rows-2grid-template-rows: repeat(2, minmax(0, 1fr))
.m-grid-rows-3grid-template-rows: repeat(3, minmax(0, 1fr))
.m-grid-flow-densegrid-auto-flow: row dense
.m-col-span-2grid-column: span 2
.m-col-span-3grid-column: span 3
.m-col-span-fullgrid-column: 1 / -1
.m-row-span-2grid-row: span 2
.m-grid-autodisplay: grid; columns auto-fit 16rem; gap: var(--m-gap, 1rem)

Row / column stacks

ClassCSS
.m-rowdisplay: flex; flex-wrap: wrap; align-items: center; gap: var(--m-gap, 1rem)
.m-coldisplay: flex; flex-direction: column; gap: var(--m-gap, 1rem)
.m-row-nowrapflex-wrap: nowrap
.m-col-autoon a child of .m-row: flex: 0 0 auto; width: auto
.c-1 … .c-12flex: 0 0 / max-width 8.333% … 100%
.m-g-0--m-gap: 0
.m-g-xs--m-gap: .4rem
.m-g-sm--m-gap: .65rem
.m-g-lg--m-gap: 1.75rem
.containermax-width: 72rem; margin-inline: auto; padding-inline: 1.25rem

Gap

ClassCSS
.m-gap-0gap: 0
.m-gap-xsgap: .4rem
.m-gap-smgap: .65rem
.m-gapgap: 1rem
.m-gap-lggap: 1.75rem
.m-gap-xlgap: 2.5rem
.m-gap-5 .m-gap-10 .m-gap-15 .m-gap-20 .m-gap-30 .m-gap-40gap: 5px … 40px
.m-gap-x-*column-gap (same named + px scale)
.m-gap-y-*row-gap (same named + px scale)

Margin

Scale: 0 = 0, 5 = 5px, 10 = 10px, 15 = 15px, 20 = 20px, 30 = 30px, 40 = 40px. Sides: t top, b bottom, l left, r right, x left+right, y top+bottom.

ClassCSS
.m-0 … .m-40margin: 0 … margin: 40px
.m-t-0 … .m-t-40margin-top
.m-b-0 … .m-b-40margin-bottom
.m-l-0 … .m-l-40margin-left
.m-r-0 … .m-r-40margin-right
.m-x-0 … .m-x-20margin-left + margin-right
.m-x-automargin-left: auto; margin-right: auto
.m-y-0 … .m-y-20margin-top + margin-bottom

Padding

Same numeric scale and side letters as margin.

ClassCSS
.p-0 … .p-40padding: 0 … padding: 40px
.p-t-*padding-top
.p-b-*padding-bottom
.p-l-*padding-left
.p-r-*padding-right
.p-x-*padding-left + padding-right
.p-y-*padding-top + padding-bottom

Width

ClassCSS
.m-w-autowidth: auto
.m-w-xswidth: 8rem
.m-w-smwidth: 12rem
.m-w-mdwidth: 18rem
.m-w-lgwidth: 26rem
.m-w-fullwidth: 100%

Surface, type, position

ClassCSS
.surfacebackground: var(--m-surface)
.elev-1box-shadow: var(--m-shadow)
.elev-2box-shadow: var(--m-elev)
.elev-3box-shadow: 0 8px 28px rgba(16,24,40,.18)
.borderborder: 1px solid var(--m-border)
.radius-smborder-radius: var(--m-r-sm)
.radiusborder-radius: var(--m-r)
.radius-fullborder-radius: var(--m-r-full)
.centertext-align: center
.mutedcolor: var(--m-fg-2)
.subtlecolor: var(--m-fg-3)
.monofont-family: var(--m-mono)
.overlineuppercase, tracked, color: var(--m-fg-3)
.text-smfont-size: 1rem
.text-lgfont-size: 1.25rem
.fw-500font-weight: 500
.fw-700font-weight: 700
.tabularfont-variant-numeric: tabular-nums
.truncateoverflow: hidden; text-overflow: ellipsis; white-space: nowrap
.clamp-22-line clamp
.clamp-33-line clamp
.hiddendisplay: none !important
.relposition: relative
.absposition: absolute
.fixedposition: fixed
.inset-0inset: 0
.z-10 .z-20 .z-50z-index: 10 / 20 / 50
.sticky-tposition: sticky; top: 0
.sticky-bposition: sticky; bottom: 0
.aspectaspect-ratio: 16 / 9
.aspect-1x1aspect-ratio: 1
.aspect-4x3aspect-ratio: 4 / 3
.aspect-16x9aspect-ratio: 16 / 9
.scroll-yoverflow-y: auto
.no-scrollbarhides scrollbars
.overscroll-noneoverscroll-behavior: none
.dividerhorizontal rule with optional label
.sr-onlyvisually hidden, available to AT
.skip-linkoff-screen until focused
.is-disabledopacity: .5; pointer-events: none
.is-loadingopacity: .7; pointer-events: none
.print-onlyhidden on screen, shown in print
.no-printhidden in print