ore in D7/D8 does the following when adding CSS stylesheets:
// Always add a tiny value to the weight, to conserve the insertion order. $options['weight'] += count($css) / 1000; // ... $css[$data] = $options;
while the documentation does state that earlier attached files will win in the order if nothing else ...
This even applies when using only #attached! (and in Drupal 8)
The algorithm will do:
I don't assume someone relies on that order, but it still is a bug and violates the specification how this should work. Only because we have different aggregation groups, this does not break horribly.
- Check if the weight exists, re-use the old weight if so.
- Another possibility is to increase the weight always instead.
- Upload patch
User interface changes
- CSS order is earliest file wins within a group with same weight