Installation
Five ways to add Veritheme, then your own theme and dark mode. The MCP server for AI tools has its own page.
CDN
No build step. The script wires every interactive component on its own.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/veritheme/veritheme-base.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/veritheme/veritheme.min.css">
<script src="https://cdn.jsdelivr.net/npm/veritheme/veritheme.min.js"></script>
The first file is the page reset: it removes the browser's margin around the page and sets your typeface on the body. Leave it out only when Veritheme joins a page that has its own. The same files are on unpkg: unpkg.com/veritheme/…
npm
Install the package, then import the CSS — and the JS if you use interactive components.
npm install veritheme
import 'veritheme/veritheme-base.min.css'; // the page reset
import 'veritheme/veritheme.min.css';
import 'veritheme'; // interactive components
shadcn CLI
Copy single components into your project; the CLI pulls in what they depend on.
npx shadcn@latest add https://veritheme.com/r/button.json
Or register the @veritheme namespace in components.json and run npx shadcn@latest add @veritheme/button:
{
"registries": {
"@veritheme": "https://veritheme.com/r/{name}.json"
}
}
Every item: /r/registry.json. Import styles/veritheme/base.css once, before the components.
Download ZIP
The compiled files of veritheme@1.3.0, the same as on npm.
Source Files
The repository: source, Sass and build scripts. Needs Node.js.
git clone https://github.com/tarasenko-by/veritheme.git
Your own theme
The library ships the Default theme. Your system from Studio replaces its tokens with one stylesheet.
Create your design system in Studio and download its package. Unzip it into your project root and load its theme.css right after the library. It sets the tokens on :root, so no attribute is needed, and its dark block follows the same .dark class.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/veritheme/veritheme-base.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/veritheme/veritheme.min.css">
<link rel="stylesheet" href="theme.css">
<script src="https://cdn.jsdelivr.net/npm/veritheme/veritheme.min.js" defer></script>
The package also holds the library files it was built on, so it works without a CDN. Keep veritheme.system.json and tokens.json next to it: the MCP server reads your system from them.
Dark mode
One class on the root element. Every token flips; components need nothing of their own.
Add dark to <html>. To follow the visitor's choice and the system setting, apply it before the page paints:
<script>
// In <head>, before the page paints: no flash of the light theme.
const saved = localStorage.theme;
const prefersDark = matchMedia('(prefers-color-scheme: dark)').matches;
if (saved === 'dark' || (!saved && prefersDark)) {
document.documentElement.classList.add('dark');
}
</script>
const dark = document.documentElement.classList.toggle('dark');
localStorage.theme = dark ? 'dark' : 'light';