Author |
Topic |
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 04 August 2002 : 04:52:05
|
I've been developing a CSS mod for Snitz 3.3.0.5 if anyone is interested. I've not seen Snitz version 4 code yet but I'm sure it will only need a few changes (if it doesn't already use CSS!) D3mon
|
|
OneWayMule
Dev. Team Member & Support Moderator
Austria
4969 Posts |
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 04 August 2002 : 12:09:55
|
Ah, I see somebody has already had a go at this. A while ago I had abandoned the idea of a CSS mod based on the complexity involved when using CSS classes. However my latest version simply replaces 'bgcolor=' / '(<font size= / color= / face=)' etc with 'style=' This allows the use of the all the current variables as follows:
<font colour="<%= strDefaultFontColor %>" face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>">
is changed to:
<font style="<%= strDefaultFontColor %> <%= strDefaultFontFace %> <%= strDefaultFontSize %>">
the file admin_config_colours is simply modified to large text fields that receive the CSS data for each definition, as can be seen here:
http://www.buildyourown.org.uk/sncssmod.gif
This system maintains the Snitz color config 'structure' and requires the least changes to the code. (I'm no good with Perl though!)
D3mon
|
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 04 August 2002 : 15:04:06
|
quote: <font colour="<%= strDefaultFontColor %>" face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>">
is changed to:
<font style="<%= strDefaultFontColor %> <%= strDefaultFontFace %> <%= strDefaultFontSize %>">
If you do it this way you lose a lot of the advantages of the classes. One extremely nice result of using classes is that the code is much easier to edit and another is that your page's size is reduced. The way you are doing it doesn't seem to be worth it somehow.
@tomic
http://www.skepticfriends.org |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 04 August 2002 : 15:26:26
|
Yeah, I've got to admit, I did get bored of searching for all the tags to replace them all and gave up in the end.
Oh well.
|
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 04 August 2002 : 19:22:56
|
The version the OneWayMule pointed to there had a nice perl script for finding/replacing all the font tags which certainly made the conversion a lot easier :)
My forums have been pretty much full CSS for about a year now, it did help a little with bandwidth and has made some things a lot easier for me to implement also.
www.daoc-halo.com |
|
|
Roland
Advanced Member
Netherlands
9335 Posts |
Posted - 05 August 2002 : 04:19:01
|
quote:
<font colour="<%= strDefaultFontColor %>" face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>">
is changed to:
<font style="<%= strDefaultFontColor %> <%= strDefaultFontFace %> <%= strDefaultFontSize %>">
the file admin_config_colours is simply modified to large text fields that receive the CSS data for each definition, as can be seen here:
http://www.buildyourown.org.uk/sncssmod.gif
This system maintains the Snitz color config 'structure' and requires the least changes to the code. (I'm no good with Perl though!)
Although the idea is nice, you're pretty much raping the whole idea and advantages of CSS into oblivion. I mean, the whole advantage of CSS is that you assign a class, say .default, that contains the font-family, font-size, font-weight, font-decoration and all that. Then use that in the cell or a tag and you don't have all the information in the HTML, but in one place. Right now you're just substituting the font tag attributes with classes, increasing the size of the HTML files.
What does it do to make the pages easier to edit: nothing. You still have to make the same changes as you would if you were using the "good old" font/table color config.
No offence, but it'd have made a lot more sense if you'd done something that checks the HTML for certain combinations of font tags, and then change them to appropriate classes. You'd end up with a .default, .header, .footer and be done. You could even replace the background colors with classes to easily add background images.
I hope this doesn't come across as a mean, I-know-it-all-better, kind of post, 'cause that's not my intention.
Roland
http://www.frutzle.com Snitz Exchange | Snitz Icons | Do's and Dont's |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
Posted - 05 August 2002 : 04:48:47
|
No worries FrutZle!
My own forums use external CSS with classes, but I wanted to see if there was a way to implement style sheets as simply as possible in a user-friendly MOD for those who may not be experienced in the way of CSS. When I learn something like CSS, I often forget how complex it all appeared when I didn't know anything about it!
Has anyone come up with a way of 'editing' the external CSS file via an admin web page?
|
|
|
|
Topic |
|