Active
Project:
Omega
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2012 at 18:07 UTC
Updated:
27 Mar 2023 at 08:38 UTC
Jump to comment: Most recent
In big sites with have different sections that requires different styles, is a better practice to distribute css files according to the site sections instead make just a large everything.css.
I think it'll be a huge improvement to Omega if this can be done automatically, without need to mess with the .info file or a lot of ifs in template.php.
Comments
Comment #1
danillonunes commentedAs a proof of concept, a made this code that do basically what I want if included in subtheme_preprocess function.
It loads css files based on theme function being called. Its also used the theme_hook_suggestions array in order to allow a bigger flexibility.
So, for example, when you access http://example.com/node/1, the theme_page function is called with page__node and page__node__1 as theme_hook_suggestions.
This code tries to add in this page files named page.css, page--node.css and page--node--1.css if they are found.
It also looks for files of the Omega's grid system and adds the files above with the properly grid's layouts. So, just like the Omega defaults subtheme-alpha-default.css, subtheme-alpha-default-wide.css, etc, it'll attempt to add the files page--alpha-default.css, page--alpha-default-wide.css, page--node--alpha-default.css, page--node--alpha-default-wide.css, etc.
I think will be great to have this in Omega core. I can do a patch, but I sill don't know if: - more people think it's a good idea; - there's a big performance issue with my actual implementation in hook_preprocess().
Comment #2
avpaderno