Skip to content
Halorav0.1.0

Getting started

Installation

Pick the path that matches your stack. Every path ends with the same stylesheet.

Package managers#

Halora ships as a tarball attached to each GitHub release. The package is @originlabsbr/halora and has no runtime dependencies. Once published to the npm registry, the same name will install with npm i @originlabsbr/halora.

Terminal
# npm
npm install https://github.com/originlabsbr/halora/releases/download/v0.1.0/originlabsbr-halora-0.1.0.tgz

# pnpm
pnpm add https://github.com/originlabsbr/halora/releases/download/v0.1.0/originlabsbr-halora-0.1.0.tgz

# yarn
yarn add https://github.com/originlabsbr/halora/releases/download/v0.1.0/originlabsbr-halora-0.1.0.tgz

Import in a bundler#

JavaScript
// everything: tokens, base, components (origin brand)
import '@originlabsbr/halora/css';

// or one layer at a time
import '@originlabsbr/halora/tokens.css';
import '@originlabsbr/halora/base.css';
import '@originlabsbr/halora/components/button.css';

// the Gabarito brand as an add-on (set data-brand="gabarito")
import '@originlabsbr/halora/brands/gabarito.css';

// behaviors, tree-shakeable
import { initTheme } from '@originlabsbr/halora/theme';
import { startReveal } from '@originlabsbr/halora/reveal';

Fonts#

Halora does not bundle fonts. The Origin brand uses Inter and JetBrains Mono, with optional Saira Condensed for large numerals. Gabarito uses Plus Jakarta Sans. Self-host them or use a font service, with font-display: swap and only the weights you use.

HTML
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400..700&family=JetBrains+Mono:wght@400..600&display=swap">

CDN#

Every release is served at an immutable, versioned path. halora@latest follows the newest release and is cached for a short time only, so pin a version in production.

FileURL
halora.min.csshttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/halora.min.css
halora.csshttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/halora.css
Gabarito bundlehttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/bundles/halora.gabarito.min.css
tokens.csshttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/tokens.css
tokens.jsonhttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/tokens.json
halora.iife.jshttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/halora.iife.js
theme-init.jshttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/theme-init.js
ES moduleshttps://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/js/index.js
HTML
<link rel="stylesheet" href="https://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/halora.min.css">
<script src="https://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/halora.iife.js" defer></script>
<script>
  addEventListener('DOMContentLoaded', function () { Halora.init({ themeKey: 'theme' }); });
</script>

Static sites with the IIFE bundle#

Sites without a build step load halora.iife.js. It defines window.Halora with every behavior. Put the pre-paint snippet in the head so the theme is set before first paint.

HTML
<head>
  <script>
    (function(){var d=document.documentElement,t="light",q="(prefers-color-scheme: dark)";
    try{var s=localStorage.getItem("theme");if(s==="light"||s==="dark")t=s;else if(matchMedia(q).matches)t="dark"}
    catch(e){try{if(matchMedia(q).matches)t="dark"}catch(_){}}
    d.setAttribute("data-theme",t)})();
  </script>
  <link rel="stylesheet" href="https://designsystem.lab.mateuseap.com/cdn/halora@0.1.0/halora.min.css">
</head>

If your Content Security Policy forbids inline scripts, serve theme-init.js instead, or generate a snippet for your own storage key with themeInitScript({ storageKey }).

Tailwind CSS#

The preset maps Tailwind theme keys to the CSS variables, so utilities follow the active theme and brand. It works with Tailwind 3. Keep importing the Halora stylesheet so the variables exist.

JavaScript
// tailwind.config.js (CommonJS)
module.exports = {
  presets: [require('@originlabsbr/halora/tailwind-preset')],
  content: ['./src/**/*.{js,jsx,ts,tsx,html}'],
};

// tailwind.config.mjs (ESM)
import preset from '@originlabsbr/halora/tailwind-preset';
export default { presets: [preset], content: ['./src/**/*.{js,ts,html}'] };
Theme keyExamples
colorsbg-canvas, bg-surface, bg-surface-2, text-ink, text-muted, text-faint, border-line, border-line-strong, bg-accent-fill, text-accent-on, text-accent-text, text-danger, text-success
fontFamilyfont-sans, font-mono, font-display
fontSizetext-display, text-h1, text-h2, text-h3, text-lede, text-body, text-small, text-caption
borderRadiusrounded-sm, rounded-md, rounded-lg, rounded-card, rounded-pill
boxShadowshadow-glass, shadow-raised, shadow-accent, shadow-overlay
Otherease-halora, duration-reveal, z-ha-header, max-w-ha-page, ha-sm and ha-md screens, p-ha-4 spacing

TypeScript#

Token names are typed, and every behavior ships declarations.

JavaScript
import type { TokenName, ColorToken } from '@originlabsbr/halora/tokens';
import { cssVar } from '@originlabsbr/halora/tokens';

cssVar('accent-fill'); // "var(--ha-accent-fill)"

Package contents#

ExportFile
@originlabsbr/haloradist/js/index.js, ESM entry with every behavior
/css, /css/mindist/halora.css, dist/halora.min.css
/tokens.css, /base.css, /components.cssIndividual layers
/components/*One CSS file per component
/brands/*origin.css and gabarito.css (scoped by data-brand)
/bundles/*Per-brand full bundles, for example halora.gabarito.min.css
/theme, /reveal, /header, /motion, /dialog, /particlesBehavior modules
/theme-initPre-paint script file
/iifedist/halora.iife.js for window.Halora
/tokens, /tokens.jsonToken names, values, and types
/tailwind-presetCommonJS and ESM presets

Edit this page on GitHub

Type to search.