Skip to content

@cssdoc/embedded

@cssdoc/embedded — read cssdoc-annotated CSS out of host files where it lives embedded: JS/TS tagged templates (styled.x`…`, css`…`, Lit, keyframes), HTML-like <style> blocks (.html, .vue, .svelte, .astro), and Markdown/MDX code fences.

The core is projectCss: it returns a character-for-character CSS projection of the host source — identical length and newlines, with the embedded-CSS regions and any /** … */ doc comment kept verbatim, everything else blanked to spaces, and JS ${…} interpolations masked. Because the projection shares every offset/line/column with the source, all downstream CSS tooling (parseCssDocs, createIndex, spans, ranges) works unchanged and correctly-positioned.

Interfaces

Type Aliases

Variables

Functions

Released under the MIT License