- Issue created by @pivica
- Merge request !2Issue #3490049 by pivica: Wrong order of CSS assets after D10.4 update → (Open) created by pivica
After Drupal 10.4 update we noticed that CSS assets are loaded in wrong order which could then mess with CSS styling, because CSS rules are in different order and rules with same specificity will be applied/overridden in different way.
Before D10.4 first CSS global theme assets were loaded and then conditional assets from components. After D10.4 the order was mostly other way around with some other changes.
The issue is coming from core change in 🐛 Logic error in Drupal's lazy load for asset aggregation Active . After discussion with @berdir and @catch on slack @berdir proposed that we solve this by introducing weights definition in our components libraries. There is a core issue 📌 Deprecate support for per-file weight in libraries API Active that is proposing to remove weights for D11, but until that is done we can use weights and later switch to new dependencies before/after definitions as per 📌 Replace custom weights with dependencies in library declarations; introduce "before" and "after" for conditional ordering Needs work issue that is for now also planned for D11.
This needs to be fixed also in bs_base theme and in any custom child theme if it defines custom components css libraries.
Active
1.0
Code