@cssdoc/core
@cssdoc/core — a generic, framework-agnostic documentation extractor for CSS, in the shape of TSDoc/TypeDoc: parse a small doc-comment grammar plus the CSS AST into a serializable model, then let an emitter turn that model into whatever output you need (markdown, JSON, a component gallery).
The core makes no assumptions about any project, class prefix, or framework. It:
- reads
/** … */doc comments in the grammar (@component,@summary,@modifier,@part,@cssproperty/@csspart/@cssstate,@example,@demo,@see, and adeprecatedtag), adopting the Custom Elements Manifest tag names where they exist; - AST-extracts the machine facts (base class,
-modifierfamilies, sub-element parts, consumed and declared custom properties, deprecated-alias links) from the actual selectors — so they can't drift; - returns a CssDocEntry[] model (one record per
@component), plus a toJson helper.
Build a project-specific emitter on top — the way typedoc-plugin-markdown builds on TypeDoc's reflections.
Example
ts
import { parseCssDocs, toJson } from "@cssdoc/core";
const model = parseCssDocs(cssWithDocComments);
writeFileSync("css-docs.json", toJson(model));Classes
Interfaces
- BuildCustomMediaOptions
- CompileCustomMediaOptions
- CssAnimation
- CssCondition
- CssDocEntry
- CssDocTagDefinitionOptions
- CssFunction
- CssLayer
- CssModifier
- CssPart
- CssPropertyDeclared
- CssRelated
- CssSlot
- CssSource
- CssState
- CssTokenConsumed
- DocCondition
- DocCssProperty
- DocModifier
- MermaidOptions
- ModifierConvention
- ModifierHit
- ParsedDoc
- ParseOptions
- StructureCustomMediaRef
- StructureNode
- StructureVariant
Type Aliases
Variables
- DEFAULT_MODIFIER_CONVENTION
- DEFAULT_PSEUDO_ELEMENTS
- DEFAULT_STATE_PSEUDO_CLASSES
- MODIFIER_PRESETS
- RECORD_TAGS