Author |
Message |
Gremmie
Former Moderator in Good Standing
![](modules/Forums/images/avatars/0cd76dcf45da5de2cf864.jpg)
Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Tue Jan 30, 2007 9:36 am |
|
Raven, that sounds good. But do we modify the core files to include both your theme's style.css and this new subSilver.css, or do we just duplicate (ugh) the subSilver.css in each style.css file? Maybe we should move towards 64bitguy's idea. ![Confused](modules/Forums/images/smiles/icon_confused.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Gremmie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Jan 30, 2007 10:01 am |
|
So maybe some conditional logic in the core files somewhere:
if the theme has a forums subfolder, then generate link tags for the theme's style.css AND the forums subfolder forums.css
else if the theme doesn't have a forums subfolder then generate a link tag for the theme's style.css AND the default subsilver.css
Then theme authors just have to make sure their CSS doesn't clash with the default subsilver.css (or provide their own forums.css file). |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Tue Jan 30, 2007 10:08 am |
|
Hopefully the only css data in subSilver.css is for the forum template itself, in which case we would 'have' to load it - just ensure it isnt being called when you are not actually in the forum module.
I have been perusing Steph's post and I think I understand where he is coming from now so I'n going to try some experiments on my own custom theme to see what discernable differences there are in terms of load times etc.
The beauty of Steph's approach is that you can prepare the ground with if else logic and creating your own constant for 'custom style inclusion' without actually breaking anything. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
Former Moderator in Good Standing
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Tue Jan 30, 2007 11:25 am |
|
Actually this fits in very well with an idea I proposed a while back. If you look at the css files for the themes in Ravennuke you'll see that there is enormous duplication. I mean upwards of 90 percent. I published some spreadsheets factoring all this out over at fkelly.org 6 months ago. What I proposed and actually had working in a test system was to consolidate the styles into a master style sheet that would always be loaded in header.php. Then if a theme needs to override an element of an existing style (say the color of a font) or add, a style that would be in the individual theme's style sheet. That's what "cascading" stands for if I am not mistaken.
The forums stuff could then be in the master style sheet and it would always be loaded (but only once) in header.php. If a forum theme needed to override the common stuff it could also do so in it's individual style sheet without repeating everything else. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Jan 30, 2007 11:58 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Gremmie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Jan 30, 2007 12:01 pm |
|
fkelly, that sounds great. When you say "loaded in header.php" I hope you mean a <link> tag is generated rather than dumping all the CSS with every page load.
We should really start using CSS like it was meant to be used...LOL. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Jan 30, 2007 3:20 pm |
|
What I did, if I recall correctly because I don't have the code here on my laptop was before the line in header where it says:
Code: echo '<link rel="StyleSheet" href="themes/'.$ThemeSel.'/style/style.css" type="text/css" />'."\n\n";
|
I just stuck a line that did the same thing for a style.css that I created in the root /themes directory. That "root" css file had maybe 30 lines in it that was derived from the "commonalities" in the existing theme css files. Then I would link to the style css for the $ThemeSel but that css file would typically have only 1 or two lines ... some had none since they didn't override anything from the common file.
I used an Excel spreadsheet to do my analysis. I just downloaded all the style files for all the themes into it and I put in the theme name along with the style and each attribute for each style. That way I could sort by style name and I'd have:
style1 theme1 attributes
style1 theme2 attributes
style1 theme3 attributes ...
style2 theme1 attributes ... you get the point
Then I could look at the attributes for each style right next to each other and see which were unique. Then I could move the most common attribute settings for a given style to my common file and only have overrides in individual theme style files where they were needed.
It also struck me that this common style file could be a great library if you were trying to develop a new theme. Look there to see what's available and avoid the need to invent a bunch of styles from scratch. Not that I think we need any more themes ... in fact, departing from the current thread a bit, what we really need to do is apply the same type of factor analysis to the theme code itself. Having just worked on a bunch of them there is just tremendous duplication and overlap of code which in turn makes maintenance a nightmare. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Gremmie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 08, 2007 8:30 am |
|
Just curious what you guys decided to do about the double head problem for the next RavenNuke? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Feb 08, 2007 10:05 am |
|
We just didn't have time to put that in place. The laundry list was huge as it was and we had to draw a line in the sand or we would have gone on forever. Basically, we stayed away from the forum in v2.10.00. We concentrated on everything else, though. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|