Skip to main content
VelinStyle v0.9.0
⌂ Home

VelinHighlight 0.9.0 extension

Token-based syntax highlighting without Prism or CDN. OKLCH token colors, lazy in-view highlighting, and velin-code-block.

Overview

JavaScript API

import { initHighlight, velinSyntax } from '@birdapi/velinstyle/highlight';

initHighlight(document);
// velinSyntax.highlightElement(document.querySelector('pre'));

HTML attribute

<pre velin-code="js" language="js"><code>const x = 42;</code></pre>

Web component

<velin-code-block language="css" line-numbers highlight="1-2">
.btn { padding: 0.5rem 1rem; }
.btn--primary { background: var(--velin-color-primary); }
</velin-code-block>

Load with bootFromDOM(document, { attributes: true, highlight: true }).