Skip to content

Packages

cssdoc is a set of small, composable packages — install only what you need. Every package name below links to its npm page.

Start here

PackageWhat it is
@cssdoc/cssdocThe whole programmatic API in one install — re-exports @cssdoc/core, @cssdoc/index, and @cssdoc/providers. Reach for this first; drop to the scoped packages when you want less.
@cssdoc/coreThe parser and model: a formal grammar and an expansive tag vocabulary that documents the modern CSS surface AST-first.

Model, config, and querying

PackageWhat it is
@cssdoc/specThe canonical tag vocabulary and the RFC-style grammar — the single source of truth the parser and grammars derive from. Zero dependencies.
@cssdoc/configLoads a cssdoc.json / cssdoc.jsonc (custom tags, extends, conventions, rules). Node-only.
@cssdoc/indexA queryable semantic index over the model, with source spans — the shared data layer for the linters and the language server.
@cssdoc/providersHost-agnostic diagnostics, completions, hover, and definitions over the index.
@cssdoc/lint-coreThe author-side doc-hygiene rules, shared by the ESLint and Stylelint plugins.

Embedding without postcss

@cssdoc/core uses postcss to parse CSS, but only parseCssDocs needs it. If you consume the model, the doc-comment grammar, the tag config, or the helpers (toJson, toMermaid) without parsing at runtime, import the parse-free entry so postcss never enters your bundle:

ts
import { parseDocComment, toJson, CssDocConfiguration, type CssDocEntry } from "@cssdoc/core/lite";

@cssdoc/core/lite re-exports everything except parseCssDocs, and pulls in no CSS parser. (The main @cssdoc/core entry statically imports postcss for parseCssDocs, so importing from it can still bundle postcss even if you only use parse-free names — use /lite when keeping postcss out matters.) When you do parse, use parseCssDocs (postcss by default) or inject any parser via ParseOptions.parse — e.g. @cssdoc/dialects's resolveParser for SCSS/Less.

Embedded CSS and dialects

PackageWhat it is
@cssdoc/embeddedReads cssdoc out of host files — JS/TS tagged templates, HTML-like <style> blocks, and Markdown fences. See Embedded CSS.
@cssdoc/dialectsResolves a PostCSS parser for SCSS and Less so cssdoc can read those sources.

Emitters

PackageOutput
@cssdoc/markdownMarkdown reference pages plus a sidebar.
@cssdoc/htmlStandalone HTML pages plus an index.
@cssdoc/jsonJSON plus the model's JSON Schema.
@cssdoc/llmsAn llms.txt digest.

Standard formats

PackageOutput
@cssdoc/cemA Custom Elements Manifest (cssParts, cssStates).
@cssdoc/dtcgW3C Design Tokens.
@cssdoc/vscode-custom-dataVS Code css/html custom data.

Editor and lint integrations

PackageWhat it is
@cssdoc/language-serverAn editor-agnostic LSP: diagnostics, hover, completion, go-to-definition — in CSS and embedded CSS.
@cssdoc/stylelint-pluginStylelint rules for doc-comment hygiene.
@cssdoc/eslint-pluginESLint rules: doc hygiene plus consumer-side class usage.
@cssdoc/typedocA TypeDoc plugin that emits CSS reference pages alongside a TS API-docs build.

The VS Code extension bundles the language server — install it from the editor, not npm: VS Code Marketplace · Open VSX (Cursor, VSCodium, Windsurf, and other non-Microsoft editors).

Syntax highlighting

PackageWhat it is
@cssdoc/tmlanguageA TextMate injection grammar for Shiki, VS Code, and other TextMate hosts.
@cssdoc/codemirrorA CodeMirror 6 highlighter for the same doc-comment vocabulary.

Released under the MIT License