Skip to content

Commit e2d9ef0

Browse files
committed
fix: prevent nested CSS in components
The Angular encapsulation currently does not support CSS nesting syntax, which can lead to run-time errors or unexpected behavior when such styles are used in component stylesheets. This change ensures that nested CSS rules flattened to maintain compatibility with the compiler. For more context, see: angular/angular#58996
1 parent 3f6b555 commit e2d9ef0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/styles/stylesheets/bundle-options.ts

+5
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,10 @@ export function createStylesheetBundleOptions(
6868
// Preprocessor specific behavior is handled in each stylesheet language plugin.
6969
resolveExtensions: [],
7070
plugins,
71+
// Angular encapsulation does not support nesting
72+
// See: https://github.com/angular/angular/issues/58996
73+
supported: {
74+
nesting: false,
75+
},
7176
};
7277
}

0 commit comments

Comments
 (0)