Enhanced Code Blocks
The Fluent code-block styling applies to ordinary Markdown fences and titled code frames. The examples below compare short snippets with long single lines, with and without a title, to show horizontal overflow.
Readers can make code blocks use the full page width from the Settings Panel.
Syntax highlighting uses the github-dark and github-light themes by default, following the site color scheme. To use other themes, set expressiveCode.themes in the Starlight configuration or in ec.config.mjs.
Terminal frames use the Fluent terminal icon by default. You can override it with Expressive Code’s styleOverrides.frames.terminalIcon setting.
Simple code block
Section titled “Simple code block”const answer = 42console.log(answer)Titled code block
Section titled “Titled code block”const greeting = 'Hello, world!'console.log(greeting)Long code block
Section titled “Long code block”const searchUrl = 'https://docs.example.com/api/search?collection=starlight-fluent&include=headings,examples,code-snippets&language=en-US&sort=relevance&pageSize=50&highlight=full&includeDrafts=false'Titled long code block
Section titled “Titled long code block”deployment: { name: documentation-search-indexer, namespace: production-documentation, image: registry.example.com/platform/documentation-search:2026.11.30, replicas: 3, region: westeurope, storage: premium-ssd-search-index, refresh: every-30-minutes, include: headings-examples-code-snippets, exclude: drafts-and-archived-pages }