Improved Drupal\Core\Ajax\AddCssCommand does not keep orders in account.

Created on 25 October 2023, about 1 year ago

Problem/Motivation

Since the introduction of the improved Drupal\Core\Ajax\AddCssCommand, CSS files gets appended inside the head instead of prepended. This breaks CSS styles.

Steps to reproduce

Trigger an event that calls `AddCssCommand` and take a look at the head.

Proposed resolution

Override the default loadjs injection to prepend CSS link elements in stead of appending (see patch)
In an ideal world, the CSS should keep the CSS 'weights' in account, so CSS component fileshould not be loaded afther a CSS theme file.

🐛 Bug report
Status

Active

Version

10.1

Component
Ajax 

Last updated about 5 hours ago

Created by

🇧🇪Belgium al0a

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

Comments & Activities

Production build 0.71.5 2024