Support for CSS Cascade Layer import in CssOptimizer

Created on 28 August 2024, 4 months ago
Updated 29 August 2024, 4 months ago

Problem/Motivation

CSS @import allows importing css into a cascade layer:
https://developer.mozilla.org/en-US/docs/Web/CSS/@import

The CssOptimizer merges imports into a single file, but currently ignores layers.

Steps to reproduce

Create a css file with enabled aggregation:

@import url('some.css') layer(some-layer);

The import will not be inlined.

Proposed resolution

Extend CssOptimizer to support layers

Remaining tasks

  1. add layer support too core/lib/Drupal/Core/Asset/CssOptimizer.php
  2. update test assets: css_input_with_import.css.optimized.css & css_input_with_import.css.optimized.aggregated.css

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
CSSΒ  β†’

Last updated 10 days ago

Created by

πŸ‡©πŸ‡ͺGermany woldtwerk Stralibu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024