Page 2 of 2

Re: CSS in Sidebarplugin

Posted: Tue Apr 07, 2009 10:21 am
by gimmel
Thanks, Garvin.
As expected, you gave the most complete answer.
1. Emit the CSS in a <style> block. Maybe even use a @import rule to load the additional style
No. I don't want to do this. It may work on most Browsers, but it's not standard compliant. CSS has to be defined in the <head> area.
2. Create a bundled event plugin (you should even be able to put sidebar+event plugin in one directory, see serendipity_plugin_adduser)
It's the most compatible way, even If I don't like the extra (nearly useless) plugin.
Give your users an instruction which CSS to add into their usual style.css files
That's ok for using the plugin in a small environment. But for a simple installation (possibly in spartacus) this does not work. Plugins should work on the fly. (Hey, I'm an Apple User!)
4. Now this is my favourite: Use javascript to inject the style tag into the DOM-Tree of the HEAD-section
Very good idea. But what if users deactivated Javascript (…for security reasons… :roll: )? The plugin output would look ugly. That's not „unobtrusive Javascript“.

I prefer solution 2. It's the only clean, compliant way.

Re: CSS in Sidebarplugin

Posted: Mon May 18, 2009 2:39 pm
by gimmel
I'm done. Here you can find the flickrShow plugin I used this CSS stuff for.