Closed (fixed)
Project:
NineSixty (960 Grid System)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2009 at 23:23 UTC
Updated:
5 May 2010 at 21:50 UTC
I can't override ninesixty's styles.css file in my subtheme. I've added this to my .info file, but ninesixty's styles.css continues to be loaded:
; override ninesixty's stylesheets by adding empty files
stylesheets[all][] = text.css
; stylesheets[all][] = debug.css
stylesheets[all][] = styles.css
text.css disappears as intended, but styles.css persists.
After a very quick glance, I think this may be a problem with ninesixty_css_reorder(). Does it check to see if a subtheme has overridden styles.css before reordering everything? Or does it interfere with the override system in some way?
Comments
Comment #1
dvessel commentedThis is because of how core handles overrides from a base theme to its child. It's not really smart about it and we got this feature by accident. (As opposed to theme styles overriding modules which was explicitly designed in.)
Ninesixty's style sheets are defined to be in a sub-directory to keep it tidy and this was defined from the .info file to point in the right place..
What the sub-theme must do is match that directory structure since the overriding behavior depends on that whole string. It's either that or keep everything flat. But then that also forces any sub-themes to be flat also. This can be worked around with code but I'd hate to do it. A standard directory structure that keeps things organized I prefer.
Comment #2
dvessel commentedBTW, the reason why text.css does override is because of that reordering. I could modify it so it's more consistent. I forgot for a second that I had that code in place. Should it be done? I was thinking of stripping it out altogether once we had css weights in core.
Comment #3
todd nienkerk commenteddvessel: Using the full path in my subtheme's .info file worked.
I replaced this:
; stylesheets[all][] = styles.css
...with this:
; stylesheets[all][] = styles/styles.css
...and styles.css vanished, as expected. I did not need to reorganize any of my subtheme's .css files into a new directory structure.
More thoughts to come...
Comment #4
armyofda12mnkeys commentedseems like this isn't needed anymore?
My override in my 960 subtheme directory is working.
(I also do have template.php and theme-settings.php though copied over (as that is what i was used to doing when doing Zen subtheme's i beleive) and inside of that zen_ninesixty_ renamed to my_theme_ where appropriate in functions and also ns() had to be deleted since would be declared twice in 960 theme and in my 960 custom subtheme)
Comment #5
dvessel commentedYeah, no longer an issue. This behavior was changed in core some time back. Directory structure doesn't have to match. Just the name of the style.