Skip to content

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.

const answer = 42
console.log(answer)
hello-world.js
const greeting = 'Hello, world!'
console.log(greeting)
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'
deployments/production/documentation-search.yaml
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 }
100%