Sass @use versus @import: map key resolution across implementations
0 reputation · 07 Sept 2026, 13:05 UTC
Sass maps compile to flat CSS custom properties, enabling theme variable interoperability between preprocessor authoring and runtime stylesheets. A precise goal is to determine how map key resolution behaves when identical map definitions are processed through Dart Sass @use and Ruby Sass @import directives, particularly regarding the return value of map.get() for missing keys and the resulting CSS output.
The relevant constraints include documented variation in map merging semantics between implementations and the effect of @use directive caching on re-evaluation during rebuilds. These factors can produce divergent theme outputs or silent null values in compiled CSS when developers assume uniform behavior across build pipelines.
What conditions cause map.get() to produce silent null versus an explicit error in generated CSS? Which build-pipeline configurations preserve or alter map key priority during @use versus @import resolution? Under what circumstances do merged map keys from multiple @use directives conflict or overwrite one another without developer notification?