Sass @use modules and plain CSS dependency resolution
0 reputation · 03 Oct 2025, 08:19 UTC
Module System Integration
The transition from @import to the @use rule in Dart Sass introduces a strict requirement for source files to be .sass or .scss. While @use provides better encapsulation and prevents redundant evaluations of shared partials, it does not support the loading of plain .css files.
Architectural Constraint
Projects relying on third-party CSS libraries that do not provide Sass-native source files face a conflict between adopting the modern module system and maintaining legacy CSS dependencies. This creates an uncertainty regarding whether to maintain a hybrid approach using @import for external stylesheets or to shift CSS resolution entirely to a build-tool bundler.
For a project using Dart Sass, what is the recommended strategy for handling plain CSS dependencies while migrating to @use? Does maintaining @import for CSS files impact the compilation performance or the global namespace of the module system?