Creating a widget, using the CSS from the theme or its own?

Dec 26, 2010 at 4:49 PM

Hi there,


I want to create a tag cloud widget but i am little confused. Should i create a generic widget with no CSS and then use the CSS in my theme?


Or should i create the CSS and ship it with the Widget (in the widget directory).


If i was to ship my widget and was stripped down i presume i would need to include a help document for others to know theme it, i.e. the IDs it uses, classes it uses etc?


Dec 26, 2010 at 6:39 PM

You should definitely provide a css, where the classes could be easily overriden in themes. The class names shoud be prefixed with the module's name.

Dec 26, 2010 at 8:33 PM

In other words, the module should remain failry generic in rendering but that doesn't preclude the use of CSS. Theme authors will be able to override both the rendering and the CSS but if you build your rendering right, most people will only need to override the CSS. As Sebastien said, that goes through defining good class names with prefixes in order to play nice with other modules.

Dec 27, 2010 at 8:50 AM

Thanks both for confirming this, i just didn't want to start out wrong... Thanks again,