Skip to content

Theme File Anatomy

A Sassy theme file is a YAML document with up to four top-level keys. When compiled, it produces a <name>.color-theme.json file suitable for VS Code.

config:
name: "My Theme"
type: dark
palette:
# colour definitions
vars:
# variable definitions
theme:
colors: {}
tokenColors: []
semanticTokenColors: {}
KeyTypeRequiredDescription
configobjectYesTheme metadata and import declarations
paletteobjectNoColour definitions — a declarative, self-contained scope evaluated before vars
varsobjectNoVariable definitions for reuse throughout the theme
themeobjectYesVS Code theme content: colours, token colours, semantic token colours
PropertyTypeRequiredDescription
namestringYesTheme display name in VS Code
type"dark" | "light"YesBase theme type
$schemastringNoSet to "vscode://schemas/color-theme" for editor validation
importstring[]NoArray of file paths to import (relative to this file)
customobjectNoArbitrary keys merged into the root of the output JSON
config:
name: "Midnight Ocean"
type: dark
$schema: "vscode://schemas/color-theme"
import:
- ./shared/variables.yaml
- ./shared/colors.yaml
custom:
semanticHighlighting: true

A declarative, self-contained scope for raw colour definitions. Palette is evaluated before vars and cannot reference anything outside itself — only its own entries. Other scopes (vars, theme) can reference palette values using the $$ alias syntax.

palette:
cyan: "#56b6c2"
grey: "#5c6370"
accent: lighten($$cyan, 20)

The above produces the following palette paths (internally prefixed as palette.*):

  • palette.cyan
  • palette.grey
  • palette.accent

The $ prefix inside variable references is shorthand for palette.:

WrittenExpands to
$$cyan$palette.cyan
$($cyan)$(palette.cyan)
${$cyan}${palette.cyan}

This expansion happens before variable resolution, so downstream tools (resolve, lint) always see the canonical palette.* form.

vars:
accent: $$cyan # resolves palette.cyan
bg.accent: darken($$accent, 70) # palette value in a function

Palette entries can reference other palette entries (using $$ syntax), but they cannot reference vars or theme values. This is enforced by evaluation order — the palette is fully resolved before any other scope is processed.

An arbitrary nested object. Keys become dot-path variable names; values are strings (hex colours, colour expressions, or variable references) or nested objects that extend the dot-path. Variables can reference palette values using the $$ alias.

vars:
accent: $$cyan
std:
bg: "#1a1a2e"
fg: "#abb2bf"
fg.accent: $(accent)

The above produces the following variable paths:

  • accent
  • std.bg
  • std.fg
  • std.fg.accent

See Variable Syntax for reference forms and resolution order.

Contains the three sections VS Code expects in a colour theme.

An object whose keys are VS Code colour identifiers (dot-notation) and whose values are colour expressions.

theme:
colors:
editor.background: $(std.bg)
editor.foreground: $(std.fg)
activityBar.background: darken($(std.bg), 10)

An array of TextMate token colour rules. Each entry has name, scope, and settings.

theme:
tokenColors:
- name: Comments
scope: comment, punctuation.definition.comment
settings:
foreground: $$grey
fontStyle: italic
- name: Keywords
scope: keyword
settings:
foreground: $$cyan

An object mapping semantic token types to colour values. Each key is a semantic token selector (e.g. variable.declaration, function.declaration, string:escape). Values can be either:

  • A string — interpreted as the foreground colour
  • An object — with foreground and/or fontStyle properties
theme:
semanticTokenColors:
# Object form — foreground and fontStyle
variable.declaration:
foreground: $(std.fg)
fontStyle: italic
function.declaration:
foreground: $$cyan
fontStyle: bold
# String form — shorthand for foreground only
"string:escape": $$yellow

Both forms support variable references, palette aliases, and colour functions.

Files in .yaml format are supported.

FormatExtensionNotes
YAML.yamlSupports comments, multiline strings, anchors

Given an input file named midnight-ocean.yaml, Sassy produces:

midnight-ocean.color-theme.json

The output is a standard VS Code colour theme JSON file containing $schema, name, type, colors, tokenColors, and semanticTokenColors at the root level, plus any keys from config.custom.