$types['styles'] = array( '#items' => array(), '#pre_render' => array('drupal_pre_render_styles'), '#group_callback' => 'drupal_group_css', '#aggregate_callback' => 'drupal_aggregate_css', );
→ #group_callback, #aggregate_callback
- Keep drupal_get_css() etc., keep everything, just make drupal_get_css() call into the container and do everything the "proper" way.
you cannot aggregate before it's compiled into target language (SASS → CSS)
B depends on A, → B in header C depends on A, → C in footer
header: AB footer: C
SERVICE <1-L asset array> DEPENDENCY RESOLUTION <1-L asset array> (<1-L asset array> COMPILATION <1-L asset array>) ( <1-L asset array> GROUPING <2-L asset array> <2-L asset array> OPTIMIZING <2-L asset array> <2-L asset array> DUMPING <1-L asset array> ) <1-L asset array> RENDERING
- Create a virtual node for each scope.
- Let any dependency within the scope depend on the scope's virtual node.
- Build dependency tree for each scope.
- Subtract the children of each earlier scope's dependency tree from a given scope's dependency tree. (i.e. FOOTER minus HEADER)