Tooling

Editor support. Syntax highlighting. Language intelligence.

Lass ships with first-class editor tooling so you get the same developer experience you expect from CSS and TypeScript — highlighting, auto-complete, bracket matching — in .lass files.

VS Code Extension

Lass Language Support — Official VS Code extension.

Install from the VS Code Marketplace:

  1. Open Extensions (Cmd+Shift+X / Ctrl+Shift+X)
  2. Search for "Lass Language Support"
  3. Click Install

Or from the command line:

code --install-extension lass-lang.vscode-lass

What you get

Supported symbols

Symbol Purpose Auto-close
--- Zone separator (preamble / CSS)
$name Variable substitution
{{ expr }} TypeScript expression interpolation Yes
@{ css } Style block Yes
@(prop) Property lookup accessor Yes
// Single-line comment (stripped from output)

Extension on GitHub


TextMate Grammar

@lass-lang/lass-tmlanguage — The canonical grammar definition.

The TextMate grammar is the single source of truth for Lass syntax highlighting. It's used by:

Usage with Shiki

import { createHighlighter } from 'shiki'
import lassGrammar from '@lass-lang/lass-tmlanguage'

const highlighter = await createHighlighter({
  themes: ['github-dark'],
  langs: [{ ...lassGrammar, name: 'lass' }],
})

const html = highlighter.codeToHtml(lassCode, { lang: 'lass' })

Usage in a VS Code extension

{
  "contributes": {
    "grammars": [
      {
        "language": "lass",
        "scopeName": "source.lass",
        "path": "./node_modules/@lass-lang/lass-tmlanguage/lass.tmLanguage.json"
      }
    ]
  }
}

What it highlights

Package on npm | GitHub


Language Server

@lass-lang/language-server — Volar-based LSP implementation.

The language server provides IDE intelligence for .lass files. It's built on Volar — the same framework that powers Vue's language tooling.

What it provides

The language server is consumed by the VS Code extension and can be integrated into any editor that supports the Language Server Protocol (Neovim, Emacs, Sublime Text, etc.).

Package on npm | GitHub


This Website

The site you're reading uses Lass tooling to highlight its own code examples:

  1. Shiki loads the Lass TextMate grammar at build time
  2. markdown-it renders Markdown pages with Shiki-highlighted code blocks
  3. vite-plugin-lass processes the site's own .lass stylesheets (dogfooding)
  4. The result is VS Code-quality syntax highlighting with zero client-side JavaScript

All highlighting is pre-rendered to static HTML during the Vite build.

Links