Mission briefing
All systems nominal.
Semetrika
Vanilla CSS, no build pipeline. Drop in to any stack and grow into your own.
By the numbers
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
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>
<button>Submit</button>
<article>
<header><h2>Mission briefing</h2></header>
<p>All systems nominal.</p>
</article>
Neither of those carries a class.
All systems nominal.
The idea
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.
<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.
Your HTML stays meaningful on its own, and a tool generating markup gets it right without learning a class vocabulary first.
The core idea
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.
<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.
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.
Every control below is rendered by the same stylesheet you would load.
emphasis
fill, over that same accent
danger
The intent word carries the status. Each component decides how to wear it.
Body copy uses the secondary font family for long-form reading. Token-driven sizes keep proportions consistent.
Small text for captions and meta.
Theming
Every visual decision is a CSS custom property. Tokens come in 3 tiers, and each tier references the one above it.
| 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 |
Add semetrika.min.css to your page as usual.
semetrika-variables.css ships beside it and holds nothing but the tokens, every name with its default value.
Put those names on :root in a stylesheet of your own. Copy 2 or copy 200.
/* 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.
Machine-readable
Every component ships a contract declaring its slots, its typed properties, and the capabilities it opts into with the words it accepts on each.
The documentation, the component explorer controls, the class registry, the capability reference and the shipped contract bundle are all generated from that contract.
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.
A tool generating markup reads the contract and enumerates exactly what a component accepts, so it does not have to guess.
How it is organised
Every part of the framework belongs to exactly one type. The reach-for test decides which.
The substrate. Tokens, colors, typography scale, icons, options. Reference material that defines how Semetrika is themed.
Shipped infrastructure. Grid, container, scrollspy, collapsible, and atomic helpers reached for by components, not placed directly on a page.
The reachable layer. Button, card, hero, navigation, and every other UI block a consumer places on a page.
Compositions. Small component combinations and full page templates that show multiple components working together.
Defaults
Every component targets WCAG 2.2 AA, and accessibility defects are treated as bugs rather than enhancements.
Every component renders and functions from markup alone. JavaScript adds behavior on top of something that already works.
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.
Browse all 70 components in the explorer, or read the source.