We run rootcandy on a multisite setup, we sometimes need to make small tweaks to the CSS. Ideally we'd like to continue running the theme from sites/all/themes to allow easier upgrading etc, instead of copying it into the sites/ folder.
These changes are usually minimal, a few color changes to work nicer with Purr module etc. How would you feel to adding a CSS file dialog where you can link to an external style-sheet outside of sites/all/themes/rootcandy.
This would allow people to customise the rootcandy theme without hacking its 'core' if you like.
Just an idea..?
Cheers,
Mark
Comments
Comment #1
sign commentedhere is a first patch to start with
Comment #2
servantleader commented+1
subscribing
Comment #3
andymantell commentedSurely this is what subthemes are for? Simply create a theme called rootcandy_custom_overrides or something and put it in your sites/SITENAME/themes folder.
Then, in the rootcandy_custom_overrides.info file put something like this:
This theme will inherit everything from the rootcandy theme but also include the overrides.css from the child theme. This saves adding custom code to the rootcandy theme to deal with a fairly specific use case. This same ticket could be opened against any of the themes on drupal.org but it wouldn't be appropriate for every theme to implement their own method of adding tweaks, hence the existence of subthemes...
Hope this helps,
Andy
Comment #4
sign commentedAndy, thanks for your feedback, but sub-themes don't share *everything* from its parent. eg. color module, which is what we are using (quite extensievely), and recently we actualy wanted to have some other tweaks to rc stylesheets, that were specific to admin section, and I think its a good idea to have this one little option tho
Comment #5
andymantell commentedAh I see, I must confess I don't use the color module, I didn't realise there were issues with sub themes.
However, overrides to anything else in the rootcandy stylesheets should be possible with the subtheme option.
Would this module help at all?
http://drupal.org/project/css_injector
I've not tried it myself, it just sounds a bit like it might do what you want.
Another way to do it would be to create a module that pulls the custom css from a variable set on each site for example, and then just adds it to the head (http://api.drupal.org/api/function/drupal_set_html_head/6). So you would still be running the rootcandy theme, but the custom module would kick in and alter things as you see fit.
I guess all I'm saying is that I think the first thought should be to try and do it without modifying the theme. I can see a situation where every theme has their own little method for adding css tweaks. Perhaps this should even be a global drupal issue rather than a rootcandy one...
Comment #6
sign commentedYea, we discussed these options on irc and it was my first impression too, to do it through own module, etc...
However, using other module, like css injector, sure why not, but to me it looks like an overkill. Sometimes the css will be just 5 lines long, etc...
Own module with drupal_add_css or head is another option, but again, it seems like an overkill, an unnecessary module to load even if it is a small one.
Maybe it is just me being the maintainer - so its easier for me to add these few lines instead of adding a module to every site. ;)
Comment #7
andymantell commentedI see what you are saying, but (correct me if I'm wrong) there is little to no overhead for having the extra module I would think, if all it is going to do is add a custom css file. So I would actually see a module as being the tidiest solution, rather than it being overkill. It's a matter of opinion I guess.
Maybe I'll work on a more general module to do this - i.e. a simple admin settings form that allowed you to enter CSS into a textarea and assign it to a particular theme.
Is that all it would need to do from your point of view? I've been looking for something to create that I can attach to my CVS application for a while now... ;-)
Comment #8
andymantell commentedHeh, only just realised you're the maintainer and not the original poster :-) If you want to add the feature then by all means, I think I'll bash out that module anyway and people can choose :-)
Comment #9
jmb commentedThis is a feature I have found lacking in themes in general. I want to be able to easily link to an external CSS file. It seems this would make it much easier for when I want to write custom CSS for individual pages.
Moodle has an easy way to add custom CSS.; simply add the CSS link to the core header.php. It is simple to replace that one after an update.
Comment #10
sign commentedI wonder, would this module be sufficient?
http://drupal.org/project/customcssjs
instead of adding a new functionality to the theme? haven't tried it