Semetrika

Semetrika

A semantic, accessible, AI-friendly design system starter kit.

Vanilla CSS, no build pipeline. Drop in to any stack and grow into your own.

Browse the design system Read the introduction

By the numbers

What the bundle ships

70

Components

Ready to place on a page

21

Utilities

Infrastructure components reach for

17

Patterns

Reference assemblies to copy

13

Capabilities

Named axes a component varies along

Getting started

Drop it in

2 files, 1 link and 1 script. Semantic HTML is styled the moment the page loads. Nothing to configure and nothing to initialize.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/drevops/semetrika/dist/semetrika.min.css">
<script defer src="https://cdn.jsdelivr.net/gh/drevops/semetrika/dist/semetrika.min.js"></script>

Then write HTML

<button>Submit</button>

<article>
  <header><h2>Mission briefing</h2></header>
  <p>All systems nominal.</p>
</article>

Neither of those carries a class.

And this is what renders

Mission briefing

All systems nominal.

The idea

Classless first, with mirror classes

Where a semantic HTML element exists, it is the primary selector. <button> is styled because it is a button. Where you do not control the markup, every element-styled component carries a mirror class that produces the identical result on a generic element.

Write either form

<button class="solid md">Save</button>
<a class="btn solid md">Save</a>

Same declarations, so the 2 forms cannot drift apart. Applying both to 1 element is redundant and unsupported.

Get the same result

Save

Your HTML stays meaningful on its own, and a tool generating markup gets it right without learning a class vocabulary first.

The core idea

The capability vocabulary

A capability is a named axis a component can vary along, and the complete list of words that are legal on that axis.

Take a button. It can be quiet or loud (emphasis), carry a status (intent), be filled or outlined (fill), run large or small (size), and sit square or pill-shaped (shape). 5 independent questions, each with a closed set of answers.

Compose the words

<button class="subtle outline sm rounded">Cancel</button>

4 values drawn from 4 capabilities, written as 4 separate words. Class order makes no difference, because precedence comes from CSS cascade layers.

Get the button

The 13 capabilities

  • intent
  • emphasis
  • fill
  • size
  • shape
  • fit
  • layout
  • orientation
  • alignment
  • position
  • visibility
  • motion
  • elevation

The same word means the same thing on every component, so learning the system once is enough. A word the system does not know styles nothing, so a wrong value shows up the moment you look at the page.

The words at work, live on this page

Every control below is rendered by the same stylesheet you would load.

Emphasis and fill

2 capabilities, 1 button

emphasis

fill, over that same accent

1 capability, 3 components

The word travels

danger

The intent word carries the status. Each component decides how to wear it.

Foundation

Typography

Heading four

Body copy uses the secondary font family for long-form reading. Token-driven sizes keep proportions consistent.

Small text for captions and meta.

Read the capability vocabulary reference

Theming

Re-theme the whole system with tokens

Every visual decision is a CSS custom property. Tokens come in 3 tiers, and each tier references the one above it.

The 3 token tiers
Tier Holds Example
Primitive Raw values on a defined scale --color-primary-5
Foundation The decisions every component shares --background-color-neutral
Component What 1 component decides for itself --btn-background-color

Start from the reference file

  1. Load the bundle

    Add semetrika.min.css to your page as usual.

  2. Read the token names

    semetrika-variables.css ships beside it and holds nothing but the tokens, every name with its default value.

  3. Redeclare what you want

    Put those names on :root in a stylesheet of your own. Copy 2 or copy 200.

Your file wins

/* my-brand.css */
:root {
  --color-primary-5: #ff6b00;
  --radius-md: 0.75rem;
  --font-family-primary: Inter, sans-serif;
}

Semetrika declares its own tokens inside @layer tokens, the weakest layer in the bundle, so an unlayered :root block beats them whichever order the 2 files load in.

The same mechanism scopes to any element, so 1 selector gives a section its own palette or spacing without duplicating a rule. Runtime options ride alongside the tokens: --option-animations, --option-rounded-corners and --option-elevation are numbers from 0 to 1 consumed as multipliers, so a whole behavior scales down or switches off from 1 property. Reduced motion follows the operating system preference automatically.

Read the token guide

Machine-readable

Spec-driven, and ready for AI tooling

Every component ships a contract declaring its slots, its typed properties, and the capabilities it opts into with the words it accepts on each.

One source

The documentation, the component explorer controls, the class registry, the capability reference and the shipped contract bundle are all generated from that contract.

No drift

None of those surfaces is written by hand, so none of them can disagree with the code. A value the CSS stopped implementing fails the build.

Legible to a model

A tool generating markup reads the contract and enumerates exactly what a component accepts, so it does not have to guess.

Read the architecture guide

How it is organised

The 4 types Semetrika ships

Every part of the framework belongs to exactly one type. The reach-for test decides which.

3 token tiers

Foundation

The substrate. Tokens, colors, typography scale, icons, options. Reference material that defines how Semetrika is themed.

21 utilities

Utilities

Shipped infrastructure. Grid, container, scrollspy, collapsible, and atomic helpers reached for by components, not placed directly on a page.

70 components

Components

The reachable layer. Button, card, hero, navigation, and every other UI block a consumer places on a page.

17 patterns

Patterns

Compositions. Small component combinations and full page templates that show multiple components working together.

Defaults

Accessible and resilient by default

WCAG 2.2 AA

Accessibility is a bug class

Every component targets WCAG 2.2 AA, and accessibility defects are treated as bugs rather than enhancements.

Progressive enhancement

Works without JavaScript

Every component renders and functions from markup alone. JavaScript adds behavior on top of something that already works.

2 color schemes

Dark mode ships

A single data-color-scheme attribute flips the page, with color tokens paired for contrast in both schemes. The control in this page header uses it.

Read the accessibility commitment

Start here

Browse all 70 components in the explorer, or read the source.

Browse the design system View the source on GitHub