Problem/Motivation
Our current CSS aggregation strategy normally uses 4 different aggregate files (though theoretically, it could use up to 6 separate files.) That's too many files. We can get that down to just 2 files (one for CSS needed on every page and one for CSS needed for a specific set of pages.)
The proposed aggregation strategy is discussed in detail over at http://drupal.org/node/1887922#aggregate
Proposed resolution
This is the first step in a proposed solution outlined at #1921610: [Meta] Architect our CSS. In short, we are changing our 3 aggregate group constants to a single group constant and adding 5 new "weight"-based CSS constants.
This patch is just the first step. It renames the current CSS_* constants to be CSS_AGGREGATE_* and adds 5 new CSS_* constants to be used for weights. It also updates the docs for drupal_add_css().
Remaining tasks
All the other steps outlined at #1921610: [Meta] Architect our CSS.
User interface changes
none
API changes
All the CSS_* constants are being renamed to CSS_AGGREGATE_*.
Comment | File | Size | Author |
---|---|---|---|
#9 | css-order-before.jpg | 170.86 KB | carwin |
#9 | cache_cleared.jpg | 17.36 KB | carwin |
#9 | css-order-after.jpg | 156.87 KB | carwin |
#8 | before_patch.jpeg | 146 KB | ykhadilkar |
#8 | after_patch.jpeg | 160.95 KB | ykhadilkar |
Comments
Comment #1
JohnAlbinHere's the patch.
Comment #2
Shyamala CreditAttribution: Shyamala commentedAdding tags
Comment #3
LittleCodingCode is well formated.
This could use more test coverage to do with the new approach to css aggregation.
Comment #4
star-szr@LittleCoding and myself reviewed this patch together during Sprint Weekend. I suggested tagging for tests but after looking at the patch again I'm reconsidering that. Back to CNR for some more reviews :)
Comment #5
JohnAlbinActually, this patch doesn't need to add tests. Because the system already has sufficient tests for drupal_add_css(); it tests aggregating and ordering. This patch just changes the CSS constants used. We don't need to test PHP's ability to set constants. :-)
Comment #6
JohnAlbinThis patch doesn't change the behavior of the Drupal in any way. Maybe that's making it tricky to review.
So maybe these review instructions would help:
Comment #7
star-szrAgreed, my apologies. Updating tags.
Comment #8
ykhadilkar CreditAttribution: ykhadilkar commentedFollowed steps in #6. CSS ordering did not change. Used firebug to verify loaded CSS. Not sure if this is correct way of identifying CSS load ordering. Please see attached screenshots.
Comment #9
carwin CreditAttribution: carwin commentedI can confirm the ordering doesn't change, RTBC time. Awww yeah!
Comment #10
webchickWell, that's definitely much nicer! Thanks for the manual testing as well!
Committed and pushed to 8.x.
This'll need a change notice.
Comment #11
JohnAlbinAdded change notice: http://drupal.org/node/1980980