Postponed
Project:
Blueprint
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2008 at 14:35 UTC
Updated:
30 Mar 2012 at 07:03 UTC
Jump to comment: Most recent file
I'm toying with the idea of completely unsetting all core and contrib CSS and having blueprint define it's own version in CSS. The advantages are considerably less CSS to override, less files for end users to download, and easier for themers to adjust the blueprint CSS and not have to worry about other modules getting in the way.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | emptiness.info | 1.9 KB | greggles |
Comments
Comment #1
m3avrck commentedHere's a function from Young at Development Seed:
Comment #2
psynaptic commentedI don't think unsetting all contributed module's CSS would help since they are so specific. Just having a look at the .css files in a typical project
find . -name *.css | xargs catshows that it would be impossible to account for everything within a theme.However, unsetting all core stylesheets sounds like a really good plan as this theme could easily take care of it.
Comment #3
psynaptic commentedSo we would have the ability to include and exclude any we choose? That could be an option then.
Comment #4
m3avrck commentedAgreed, unsetting core would alleviate all of those unnecessary overrides and make it much simpler. Some kind of logic to do if function_exists() and include copies of each overridden module CSS would be useful.
As for contrib, that function might be commented out. For the aggressive, they could uncomment, everyone else, could leave. That might be best case.
I imagine in the CSS folder we'd have a folder called "modules" and then break it down with poll.css, book.css, etc... and then have blueprint.css provide all core stuff.
Comment #5
psynaptic commentedI see. This could be very useful then.
I imagine we could do the same for contrib:
This would cut down on all those redundant rules that are only going to be overridden by the theme.
Is this how you see it working?
Comment #6
m3avrck commentedPrecisely. Then using Firebug with FF the amount of overridden styles should be more or less 0 --- easier debug, considerably faster render time, and a whole lot less CSS being downloaded.
Comment #7
psynaptic commentedGreat stuff, I'm sick of seeing so much cruft with all the redundant rules. We should definitely add this.
Comment #8
michelleI don't use this theme... Just was intrigued by the title in the global tracker. I'd definitely say -1 to removing all module CSS unless you want complaints from advforum users. ;)
Michelle
Comment #9
psynaptic commentedHi Michelle, I agree that removing all module CSS would be pretty dumb but since it's going to be optional to do this and given the method above it seems to me like a great idea.
Comment #10
michelleFor most modules with minimal theming, yeah, but it wouldn't work well with advforum. If it's optional, I guess advforum users would just opt out of it, then.
Michelle
Comment #11
psynaptic commentedThere are even 2 levels of optional. First the function is commented out in template.php therefore setting it to completely disabled by default. Then, if the developer decides they would like to optimise their theme they need to follow the steps outlined in #5.
You should try this theme, it's really nice and would be great to have comments from you on how blueprint and advforum play together.
Comment #12
michelle"would be great to have comments from you on how blueprint and advforum play together."
Haven't tried it but I can guarantee they won't place nice together out of the box. See this issue for details.
I don't have time for any theming stuff right now. Just was intrigued by the title of this issue.
Michelle
Comment #13
nball commentedPrevious to this theme's release, my team and I were using Blueprint CSS extensively. We decided to override ALL css from core and modules by removing them from _phptemplate_variables. We did this to have granular control over all css, per client needs. For extreme cases like ours, this was a HUGE improvement for customization.
I am testing this theme (well done!) now so my/our opinion may change...
This was our function (not as sexy as m3avrck's):
For sites using special modules like advforum we grabbed and changed the css from the module and included within our custom styles doc. This is easier than #5 I think.
Speaking of which, advforum's css has a lot of redundancy. Not a slam, just had to condense it for our purposes.
Comment #14
designerbrent commentedUsing the code in #1, I just finished writing the 'exclude' part of this. It gives the user a section on the theme settings page and then allows them to check which css file they want to exclude from the page. This allow some fine grained control of what gets removed and what is allowed to stay.
Now we need to work on creating the css files the css files that go into the them to replace the core styles. I haven't written the 'include' part of the UI yet, but i was just thinking it could be done with either a single checkbox to replace the selected 'core' css with the blueprint versions or we could possibly read through the folder blueprint css folders and list the files available for inclusion.
Anyone have any comments on this?
Comment #15
bryan kennedy commentedI really like the idea of being able to unset the core CSS. But, we should preserve module css in most situations. We could add a config tool that allows you to pick which module css to enable or disable. If a developer bothers to write special css for their module it's almost always near essential. At least in my experience.
Comment #16
designerbrent commentedI think it is imperative that you be able to choose what gets removed and what stays in your theme. The version I have running right now only gives you options to disable core css files. Adding the others won't be too hard.
Comment #17
epiphanydigital commentedHonestly, I think a great functionality would be for the template.php to check and see if a module css already exists in the template's directory, and if so, use that one. I aggregate and minify all my css, so I'm not totally sold on managing multiple css files from the contents of one long file (ie copy/pasting content into my main template css)... or keeping up with what styles I have to remove and maintain whenever I remove an old worn out module. Core already does this in some capacity with the tpl files, why not just add the ability to do the same by copy/pasting a css file from modules, not just from themes?...just realized the long drawn out way that all you need to do is add the css file to your theme and drupal core takes care of excluding the module's css file automatically.
Comment #18
michelle@epiphanydigital: That's already a feature of core. Just add the .css file to your theme's .info file.
Michelle
Comment #19
epiphanydigital commentedThanks Michelle, ha, would've saved me 45 minutes to have refreshed this page 45 minutes ago when you posted that! :-P
Comment #20
avpadernoI don't think that is a good idea to remove the CSS files used by third-party modules, even it is something the administration users can enable at their pleasure. It would impair those modules that need some CSS styles more, and administration users are not aware of which modules use extra CSS styles (would we suppose they check the code of all the modules they use?).
To make an example, suppose you install Views, which implements some JavaScript code to make the page more dynamic; if you remove the CSS styles it adds, its settings page will not properly work.
Comment #21
gregglesHere's an info file that eliminates all core styles for 6.x. I won't argue whether or not this is a good idea just yet - but I had a very specifically themed site where I want to try this out.
Comment #22
keesje commentedHi Greg,
Thanks for sharing this, interesting approach.
Kees
Comment #23
designerbrent commentedMoving this forward to the 2.x branch.
Comment #24
designerbrent commentedComment #25
aldenjacobs commentedhttp://drupal.org/project/stylestripper
Comment #26
zdean commentedsubscribe
Comment #27
zdean commentedI'm unable to use @font-your-face module because (I think) of this issue. For grid designers who are interested in typography, this is a big setback. Is there any update on addressing/fixing this in the theme?
Thanks!
Comment #28
zdean commentedmy issue with fontyourface has been resolved...it was unrelated to this issue.
Comment #29
andypostsubscribe
Comment #30
ms2011 commentedupdated for D7:
with example: in html.tpl.php:
Comment #31
keesje commentedThanks Mike! Little note: PHP tag style is php > 5.4 .