inlineCritical CSS breaks CSS layer order #30031
Labels
angular/build:application
area: @angular/build
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Command
build
Is this a regression?
The previous version in which this bug was not present was
18.2.3
Description
Hi,
since I updated to angular 19.2.5 the
inlineCritical
CSS optimization seems to behave different, in terms that the layer order line is not longer present in the inlined CSS.With 18.2.3 the inlined CSS looked like so:
After upgrading to 19.2.5 it looks like so:
This breaks the layering in cases where CSS, already using the layers are inlined, but the layer ordering line not. The ordering of the layer always needs to be the first @layer rule, otherwise it's ignored.
Minimal Reproduction
(with @angular/cli@18.2.3 active)
ng new layertest
src/styles.scss
:ng serve --configuration=production
ng update @angular/cli @angular/core
ng serve --configuration=production
@layer layer1,layer2;
) is missingException or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: