Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Svelte Section HighlighterNew to Visual Studio Code? Get it now.
Svelte Section Highlighter

Svelte Section Highlighter

Morten Høgholm Pedersen

|
1 install
| (0) | Free
Highlights <script>, <style>, and markup sections of Svelte files with distinct background colors.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Svelte Section Highlighter

Visually distinguish the three sections of a .svelte file — <script>, <style>, and markup — by giving each a distinct background color directly in your editor.

Features

  • Highlights <script> blocks with a configurable background (default: warm amber tint).
  • Highlights <style> blocks with a configurable background (default: cool blue tint).
  • Highlights the HTML markup area with a configurable background (default: subtle dark tint).
  • Colors are reflected in the overview ruler (the minimap scrollbar gutter) for quick orientation.
  • Works automatically on any open .svelte file — no commands needed.

Demo Screenshot

Requirements

  • VS Code 1.85.0 or newer.
  • A Svelte project (no additional Svelte tooling is required by this extension).

Extension Settings

All colors can be changed via Settings → Extensions → Svelte Section Highlighter, or directly in settings.json:

Setting Default Description
svelteSectionHighlighter.scriptBackground #FFC8001F Background for <script> sections
svelteSectionHighlighter.styleBackground #00C8FF1F Background for <style> sections
svelteSectionHighlighter.markupBackground #0000000F Background for markup sections

Colors support hex (#RRGGBB, #RRGGBBAA, #RGB), rgb(), rgba(), and hsl() formats. The VS Code color picker is available directly in settings for hex values.

Example (settings.json):

"svelteSectionHighlighter.scriptBackground": "#ffff0010",
"svelteSectionHighlighter.markupBackground": "#ff000010"
"svelteSectionHighlighter.styleBackground": "#0000ff10",

License

CC BY-NC-ND 4.0 — free to use for non-commercial purposes; no modifications or redistribution.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft