Skip to content

docs: expand CSS module import documentation#3374

Merged
bartlomieju merged 2 commits into
mainfrom
docs/css-module-imports
Jun 30, 2026
Merged

docs: expand CSS module import documentation#3374
bartlomieju merged 2 commits into
mainfrom
docs/css-module-imports

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Expands the with { type: "css" } documentation in the modules guide to
cover the details requested in #3257, which the existing short section
left out.

Adds the dynamic import(..., { with: { type: "css" } }) form, the
read-permission requirement for loading a stylesheet from disk, and a
description of the slice of the CSSStyleSheet interface that Deno
actually implements: cssRules as a frozen array of CSSRule (not a
live CSSRuleList), CSSRule.cssText, replace/replaceSync dropping
top-level @import rules, and the new CSSStyleSheet() constructor
without support for its options argument. Also spells out the
limitations that follow from Deno having no DOM: a sheet can't be adopted
anywhere, the rule list comes from a naive top-level split, and
insertRule/deleteRule are not implemented.

I verified each of these claims against the implementation in
ext/web/css_stylesheet.rs before documenting them.

Closes #3257.

Document the dynamic import form, the CSSStyleSheet surface Deno
implements (frozen cssRules array, CSSRule.cssText, replace/replaceSync
dropping @import, the constructor without options), the read-permission
requirement, and the no-DOM / no-insertRule/deleteRule limitations.

Closes #3257.
Comment thread runtime/fundamentals/modules.md Outdated
@bartlomieju
bartlomieju merged commit a28f780 into main Jun 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document CSS module imports (with { type: "css" }) under --unstable-raw-imports

1 participant