Skip to main content

Installation

Semetrika ships as one CSS file and one JavaScript file. Include them in your HTML and every component becomes available.

The files​

Each release publishes both a full (expanded, readable) and a minified variant:

FilePurposeSize
semetrika.cssFull CSS, human-readable, source-mappedlarger
semetrika.min.cssMinified CSS, production usesmaller
semetrika.jsFull JS, human-readable, source-mappedlarger
semetrika.min.jsMinified JS, production usesmaller

Use the .min.* files in production. Use the non-minified versions in development when you want to read the compiled output or debug a component.

Three ways to include the bundle​

1. jsDelivr CDN (no install)​

The fastest path - one <link> and one <script> in your <head>, no build tooling required. jsDelivr serves Semetrika directly from the GitHub release tag:

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

The @v0.1.0 segment is the release tag. Pin to an exact tag in production so the URL is byte-stable for cache invalidation, audit, and supply-chain hardening. Range pins (@v0 for the latest 0.x release) become useful once more than one tag has shipped.

This is the drop-in mode. It works on a static HTML file, a CodePen, a CMS template, or any environment that lets you write a <link> tag.

2. Bundler install (yarn / npm via GitHub)​

If your project already has a build pipeline, install Semetrika directly from GitHub:

yarn add semetrika@github:drevops/semetrika#v0.1.0

or

npm install github:drevops/semetrika#v0.1.0

The #v0.1.0 selector pins to the v0.1.0 git tag. npm reads the package's own package.json#name to land it at node_modules/semetrika/. Yarn requires the explicit semetrika@ alias prefix in Berry (v2+). Reference the bundle from node_modules:

<link rel="stylesheet" href="node_modules/semetrika/dist/semetrika.min.css" />
<script src="node_modules/semetrika/dist/semetrika.min.js" defer></script>

Or, inside a bundler that resolves module paths, import the CSS in your entry file:

import 'semetrika/dist/semetrika.min.css';

3. Direct download​

Download semetrika.min.css and semetrika.min.js from the GitHub releases page and drop them into your project's static assets:

<link rel="stylesheet" href="/assets/semetrika.min.css" />
<script src="/assets/semetrika.min.js" defer></script>

Use this when you want to self-host the bundle (air-gapped environments, organizational CDN, vendoring policy). It is the alternative to the jsDelivr CDN channel - same files, served from your own infrastructure.

Choosing a ref​

The segment after @ in a jsDelivr URL (and after # in a package.json dependency) is a git ref. Three kinds are supported, with different trade-offs.

Stable - pin to a release tag (production default)​

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/drevops/semetrika@v0.1.0/dist/semetrika.min.css" />
yarn add semetrika@github:drevops/semetrika#v0.1.0

The full list of release tags lives on the GitHub releases page - the most recent entry is the latest stable tag.

Two flavours of tag reference:

  • Exact tag (v0.1.0) - byte-stable, cached forever by jsDelivr, the right default for production. Subresource Integrity hashes only make sense on a byte-stable URL.
  • Range tag (v0) - tracks the latest release within a major. Useful for patch-roll-forward, but only meaningful once multiple tags ship in the same major.

Commit - pin to an exact commit SHA​

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/drevops/semetrika@a73dd95ee454035a5e6bd204bf3dda0bb3cffef8/dist/semetrika.min.css" />
yarn add semetrika@github:drevops/semetrika#a73dd95ee454035a5e6bd204bf3dda0bb3cffef8

A commit SHA is byte-stable like a tag - same caching, same SRI compatibility - but lets you pin to any commit on the history graph, not only release boundaries. Useful for:

  • Reproducing a regression that was fixed on main but not yet released.
  • Pinning a downstream project to an exact upstream state during a refactor.
  • Hosting a feature-branch preview that survives further main commits.

Use the full 40-character SHA in jsDelivr URLs. package.json selectors accept either the full SHA or a 7+ character abbreviation, but the full SHA is the safer default - it never collides with a future commit.

Dev - track the tip of main​

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/drevops/semetrika@main/dist/semetrika.min.css" />
yarn add semetrika@github:drevops/semetrika#main

@main always reflects the latest commit on the main branch and is useful for previewing unreleased work in a staging environment. Do not pin a production site to @main - the contents change without notice, jsDelivr caches main aggressively (the version you served yesterday is not the version you serve today), and any regression on main immediately becomes a regression in production. Use a tag or a commit SHA in production.

Upgrading​

Upgrading is a one-line edit:

  • jsDelivr CDN - replace the ref segment in the URL: @v0.1.0 → @v0.2.0 (or to a new commit SHA).
  • Bundler install - replace the ref in your package.json selector (#v0.1.0 → #v0.2.0) and re-run yarn install / npm install.
  • Direct download - re-download the bundle from the new release on the GitHub releases page.

No data migration, no codemod, no build step on the consumer side. Read the release notes for the target tag before upgrading across a major version - those are the boundaries where breaking changes are allowed.

Subresource Integrity​

For <link> and <script> tags, you can add an integrity attribute so the browser refuses to execute the file if its hash does not match. Generate the hash locally:

printf 'sha384-%s\n' "$(openssl dgst -sha384 -binary semetrika.min.css | openssl base64 -A)"

Or fetch it from jsDelivr's API for the exact ref you are pinning to (tag or commit SHA both work):

https://data.jsdelivr.com/v1/package/gh/drevops/semetrika@v0.1.0

The response lists every file in the package along with its SHA-256, SHA-384, and SHA-512 hashes - paste the sha384 value into the integrity attribute:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/drevops/semetrika@v0.1.0/dist/semetrika.min.css" integrity="sha384-…" crossorigin="anonymous" />

SRI only works with byte-stable URLs - pin to an exact tag or a commit SHA, never to @main or to a range.

That is it​

Once the two files are loaded, every component works:

<button>Submit</button>

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

<details>
<summary>FAQ question</summary>
<p>Answer body.</p>
</details>

No initialization, no setup, no configuration required. JavaScript behaviors auto-wire via data-* attributes.

Browser support​

Semetrika targets evergreen browsers with native CSS custom properties, :has(), and modern flexbox / grid support. No polyfills are shipped. See Browser support for the exact version floor and the CSS features Semetrika relies on.

Next steps​

  • Tokens - override colors, spacing, radii without leaving the consumer site.
  • Color schemes - opt in to the bundled dark scheme.
  • Extending - build consumer components that fit Semetrika's conventions.