Concepts

How Distillate turns tagged templates into CSS, in engine order: bind, author, collect, emit.

  • The distillery — createDistillery and DistilleryOptions
  • Tokens and vars — theme trees, lightDark, cq, contextualVar, vars
  • Authoring — modules, handles, css, rule, media, variants
  • Reachability collection — StylesCollector
  • Naming and output — the four-way matrix
  • Ordering and specificity — base rules before at-rules
  • Single-copy invariant — one loaded copy of the package

Named variations are a guide: Declare and select variations. Literal values for non-CSS surfaces: Read values outside CSS.

Previous
Your first stylesheet
Next
The distillery
  • View as Markdown
  • Edit this page
  • Distillate

  • Getting started
    • Installation
    • Quick start
    • Your first stylesheet
  • Concepts
    • The distillery
    • Tokens and vars
    • Authoring
    • Reachability collection
    • Naming and output
    • Ordering and specificity
    • Single-copy invariant
  • Guides
    • Distillate vs CSS-in-JS
    • Declare and select variations
    • Read values outside CSS
    • Ship a compact artifact
    • Integrate with a React renderer
    • Migrate from Emotion
    • Test the var invariant
    • Avoid readable-name collisions
  • Reference
    • Entry points
    • Environment
    • Generated API
    • @elastic/distillate
      • emotion
      • index
      • testing
    • OKF map
Elastic logo

© 2026 Elasticsearch B.V. All Rights Reserved.

  • Terms of Use
  • Privacy