[dokuwiki] Re: CSS Dispatcher

  • From: Anika Henke <a.c.henke@xxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 11 Nov 2005 18:23:42 +0100

Hi!

Good idea. I thought about adding support for a style.css file
anyway to  keep templates more similar to the plugins.

Wouldn't it be better and more flexible to have a template-function that can be used in main.php, etc. that passes on each needed css file (individually per template)?

Any suggestions on how this should look like? I thought my self about
adding the names of the stylesheets into the style.ini file. Something
like:

[stylesheets]

layout.css = screen
design.css = screen
print.css  = print

[replacements]

__background__ == #fff


That would be fine with me. And it makes sense, as you can put replacements *in the same file* as the information *where* to replace them. But then again, css.php is not only there for replacements ...
And that would mean that template developers *have to* use the style.ini. I don't know if that is a disadvantage, though!?


Your suggestion of using a template function has the charm of being able
to selectively choose different stylesheets in different php templates
instead of always loading everything. But I guess the call could look
somewhat messy with multiple stylesheets.

Yes, that's how I handled the various css files at first (e.g. the media_something.php's did call my own media.css and not all of the other css files, and media.css was not called by main.php, just by the media_something.php's). But as that can be handled differently and performance would not suffer too much, I would not mind using the first solution ...


I think, yes, I'd prefer defining all needed css files in the style.ini.

By the way, currently you are only distinguishing between screen and print css files. What about the other media types (handheld, braille, aural, projection, etc.)? The way you mentioned "layout.css = screen", it seems like you already thought about that!?


Anika

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: