[dokuwiki] Re: CSS Dispatcher

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 31 Oct 2005 09:15:50 +0100

Chris Smith writes:


* More work on Javascript and CSS dispatchers
I took a quick look at the CSS side of things very nice.

I'm glad you like it :-)

A couple of things spring to mind.
- I notice you have support for a user stylesheet in the conf directory. Would this be better located in template directory, or if not, can there be an option for a template specific style sheet. e.g. the sidebar template uses the exact same files as the default template + an extra CSS file, an extra php file and a few lines changed in main.php. This makes it very easy to upgrade the template when dokuwiki upgrades. As things stand, the sidebar.css file and (potential) sidebar.js files will not be included in the compressor and will need to be specified separately. Not a big issue, but it would be nice to include them in the compressor.

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


- I like the style replacement idea. Is there any chance of using a php file rather than an ini file? (It means I need to write an ini file handler to go with the configuration class (see plugin:config) to enable interactive editing of style settings. :-)

I thought about using the usual mechanism. The problem is we use # as a comment character there - bad idea if you want to specify something like #f5f5f5 as replacement ;-) An ini-reader is built into PHP so I used this.


You used tokens surrounded by double underscores for the variables. Is there a reason not to use '@' as used signatures and page templates?

Keys in ini files are somewhat restricted. I'm not sure if @ is allowed there.
Would it be possible to also have the contents of a global variable merged with the style replacement array?

That opens up the ability for user selected stylesheets via template's main.php and @import url(__USER_SELECTED_STYLESHEET__); in the style sheet.

Hmm... I'm not sure if I understand you here. Why not:

@import url(<?php echo $conf['userstyle']?>);

Andi

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

Other related posts: