Performance-conscious Drupal sites can't afford to send CSS for both 12- and 16-column layouts when only one layout is in use. I propose creating two new stylesheets that contain styling for *only* 12- or 16-column layouts. These new stylesheets would be included with the theme but would be completely optional. Only knowledgeable themers would need to override NineSixty's main, dual-purpose CSS file with one specific to their site's layout.
So why is this important? Large Drupal sites can't contain any cruft for performance reasons. This means they can't use NineSixty as a base theme because it doesn't offer slimmer CSS alternatives out of the box. This marginalizes NineSixy's potential as a base theme because themers cannot subtheme it *as-is.*
Comments
Comment #1
dvessel commentedThis sounds good but how would a sub-theme choose? Sub-themes can override what's in the base theme but it can't enable what was never enabled. It shouldn't be hard to work around.
Comment #2
todd nienkerk commentedWould it be possible to provide a relative path that backs out of the theme dir and grabs a file from <../ninesixty/styles>?
Comment #3
dvessel commentedI'm not sure how that would solve it. What do you think of allowing an extra setting in the .info file? Something like this:
If none is set, the combined styles are included. All it would need to do is dig through the global $theme_info and process.
Comment #4
todd nienkerk commented@dvessel: I think .info is the way to go. Can subthemes use .info settings from the base theme?
Also, how can an admin back out of a 12-or-16 choice? Can there be a third option to say: "I want support for both"?
Comment #5
dvessel commentedI don't think we should have a third choice. Have it always default to the full style sheet and let the themer flip it on from the sub-theme. This is primarily an optimization so I don't see a need to have it inherited. When starting a sub-theme, there should be a choice for either mode without resorting to a special choice to bringing the full style sheet back.
What do you think?
Comment #6
todd nienkerk commented@dvessel: Do you think there's a possibility that someone would try to mix 12- and 16-col layouts?
Comment #7
dvessel commentedI think so, not many perhaps but that option should be left alone. There are some things that can be achieved in one mode vs. the other. When we were emailing each other, we talked about *3* options. The 1 combined styles, and the two separate styles for 12 and 16 columns. Letting Drupal merge the two separate styles would make it even larger than the combined styles.
Inheritance would only affect sub-themes based on other sub-themes. The reason I'm a little against inheriting the setting is because anything based on the framework depends on markup changes. Most sub-themes would have their own page.tpl.php file unless the sub-theme does not change the layout. Defaulting a theme to either 12 or 16 columns because its parent set it doesn't make sense to me for that reason.
It would also make the code simpler by not having to dig through and traverse the chain of inheritance.
I might be focusing too much on layout. It would be useful when sub-themes have tweaks outside of any hard set grid classes but forgetting to set one of the separate styles simply makes the download a little larger. It's an optimization and I see the strength of developing in the framework more important.
Comment #8
juan_g commentedSomething interesting related to this issue, from the Drupal.org redesign implementers group:
"The new d.o [drupal.org] theme is based on a 12-column 960.gs implementation. All 16-column stuff has been pulled to streamline the CSS."
Comment #9
dvessel commentedsee #538992: Sweeping changes for upcoming 2.0.
There will be 3 versions. 12, 16 or combined.
Comment #10
juan_g commentedThat's great, thank you!
Comment #11
dvessel commentedIt's in 6.x dev release along with some other goodies. I'll be rolling a beta before a 6.x-1.1 release.
http://drupal.org/node/613072#comment-2869376