SF Code

The Code block restyled for dark backgrounds: a tinted panel with a glowing border and monochrome highlighting in --sf-color. Same properties as Code.

Examples

Properties

NameTypeDefaultDescription
codestring''Source to display. Highlighted during server-side rendering when set; otherwise slotted text is highlighted after hydration.
language'ts' | 'html' | 'css'autoLanguage to highlight as. When omitted, text starting with < is treated as HTML and everything else as TypeScript.

CSS variables

NameTypeDefaultDescription
--sf-color<color>#f90Tint for the border, glow and all token colours.
--code-*<color>derived from --sf-colorThe Code block's palette variables still apply and override the derived colours when set.

Usage

This component extends zakuni-code, so both files are needed when copying it into a project. Highlighting and the code / language properties behave exactly as in Code.

Implementation