meta.load-css($url, $with: null) is a mixin: it loads the module at $url and includes that module’s CSS only where you @include it. It does not expose variables, mixins, or functions. Dart Sass 1.23+. Load with @use "sass:meta".
Official sample idea.
Nest dark-theme code styles under body.dark and configure $border-contrast with $with: ("border-contrast": true).
Shorthand.
Official docs: meta.load-css is shorthand for meta.css(meta.load($url, $with)).
URL is a module string.
Pass a string like you would to @use—not a CSS url(). Relative paths are relative to the current file.
Examples target Dart Sass 1.23+ with @use "sass:meta". Each sample shows a partial plus the including file. Open View Compiled CSS for verified output (matches official Sass docs samples where shown).
Example 1 — Include CSS from Another File
Load a partial’s CSS at the top level without importing its members.
Includes another module’s CSS where you call the mixin.
No members — CSS only; use @use for the API.
$with configures !default variables with bare names.
Nestable under selectors, media queries, and more.
One line: when you need another file’s CSS in a specific place (with optional config), use @include meta.load-css($url, $with: null).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:meta"
2. @include meta.load-css("path/to/module")
3. Optional $with: ("name": value) for !default vars
4. Nest under a selector / @media when needed
5. @use the module separately if you need its members
Frequently Asked Questions
meta.load-css($url, $with: null) loads the module at $url and includes its CSS as if that CSS were written where you include the mixin. It does not import variables, mixins, or functions into the current file.
@use loads a module and makes its members available (once, at the top). meta.load-css only pulls in CSS, can appear anywhere—even nested under a selector—and accepts a configurable $with map. It never exposes members.
An optional map from variable names (without $) to values. Those values configure !default variables in the loaded module, similar to @use "…" with (…).
The module is evaluated only once, like @use. You also cannot provide configuration to a module that was already loaded—configured or not.
It is a mixin from sass:meta. Always use @include meta.load-css(...). It emits CSS; it does not return a value. Official docs: shorthand for meta.css(meta.load($url, $with)).
Dart Sass 1.23+. LibSass and Ruby Sass do not provide this mixin. Prefer current Dart Sass.