Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
A syntax-highlighted code block with copy-to-clipboard, line numbers, focus mode, diff support, and multi-file tabs. Already used throughout these docs and shipped as a VB dependency, but independently usable on any HTML page.
@profpowell/code-blocknpm install @profpowell/code-block
import '@profpowell/code-block';
Already in Vanilla Breeze: import is already done by src/doc-extras.js, so any VB-built page can use <code-block> directly without additional setup.
The block chrome (header, copy button, focus dim) reads VB color and spacing tokens. Theme switching re-skins the chrome; the syntax-highlight palette is governed separately by the highlight.js theme attached on the host.
| Feature | Attribute |
|---|---|
| Multi-file tabs | Wrap blocks in <code-block-group> |
| Line highlighting | highlight-lines="3,5-7" |
| Focus mode (dim non-highlighted lines) | focus-mode |
| Line numbers | line-numbers |
| Filename header | filename="src/foo.js" |
| Lazy highlighting | lazy |
| Diff support | language="diff" with +/- prefixes |
| Open in CodePen | codepen attribute |
See the README for the complete attribute and CSS-property reference.
Wrap a code-block element around the snippet you want to highlight. Pass the language, optional line-numbers, highlight-lines, and focus-mode:
<code-block language="javascript" line-numbers highlight-lines="2-3" focus-mode>
function greet(name) {
const message = `Hello, ${name}!`;
console.log(message);
return message;
}
</code-block>