If you composes: a class that doesn't exist in the same file, lightningcss silently accepts it. The exports object
points to a hashed name that's never emitted as a CSS rule, so the class lands on the DOM but has no matching
styles. No error, no warning.
.historyChevron { color: blue; }
.historyChevronOpen {
composes: historychevron; /* typo, real class is .historyChevron */
transform: rotate(180deg);
}
cssModules: true, builds fine. color: blue never inherits.
postcss-modules-scope errors on this with referenced class name "historychevron" in composes not found
(source).
In src/css_modules.rs handle_composes, the same-file branch hashes name.0.as_ref() into a reference with no
lookup against exports_by_source_index. The cross-file branch does look up but silently continues on miss.
If you
composes:a class that doesn't exist in the same file, lightningcss silently accepts it. The exports objectpoints to a hashed name that's never emitted as a CSS rule, so the class lands on the DOM but has no matching
styles. No error, no warning.
cssModules: true, builds fine.color: bluenever inherits.postcss-modules-scope errors on this with
referenced class name "historychevron" in composes not found(source).
In
src/css_modules.rshandle_composes, the same-file branch hashesname.0.as_ref()into a reference with nolookup against
exports_by_source_index. The cross-file branch does look up but silentlycontinues on miss.