Log in

View Full Version : Best way of adding custom CSS as part of a plugin


Spleasure
09-29-2005, 09:01 PM
I am working on a plugin, and I like the new product/plugin system very much. I just need to add a couple of custom style definitions to the main CSS file, but I wonder how that can be done in the best way. I could just add it to EXTRA or EXTRA2, but then uninstall becomes difficult. Another option is to put it in a template, and load it with misc.php?do=page&template=nameoftemplate, which I also use for my javascript file. Is there an option which I have overlooked?

[edit]
The last option does not work, because FireFox doesn't like CSS files with Content-type: text/html.

XTF
02-21-2006, 05:46 PM
I would like to know this too.
Anyone?

I'm also wondering why the main CSS is inline and not in an external file.

Spleasure
02-22-2006, 04:40 AM
I would like to know this too.
Anyone?

I'm also wondering why the main CSS is inline and not in an external file.

That's an option. Make clientscript/vbulletin_css/ writable , enable the setting in the options menu and vBulletin will write the CSS to that directory.

Luggruff
02-22-2006, 06:06 AM
is this a plugin that will enable adding new css selector fields in the style manager? Like this? (http://www.luggruff.se/cssselector.PNG)

That's an option. Make clientscript/vbulletin_css/ writable , enable the setting in the options menu and vBulletin will write the CSS to that directory.

how to make it writeable?

XTF
02-22-2006, 06:11 AM
is this a plugin that will enable adding new css selector fields in the style manager? Like this? (http://www.luggruff.se/cssselector.PNG)



how to make it writeable?
No, my plugin won't add new fields to the Admin CP CSS editor.

chmod 777 should make it writable.

sinaluna
03-14-2006, 08:18 AM
bump.

Figured out a good way to do this and used it in my new modification https://vborg.vbsupport.ru/showthread.php?t=110401

Spleasure
02-04-2007, 08:01 AM
bump.

Figured out a good way to do this and used it in my new modification https://vborg.vbsupport.ru/showthread.php?t=110401

I might be mistaking, but does your method cause that your CSS is added to the CSS file which is cached in clientscript/vbulletin_css?

RedTyger
02-04-2007, 12:05 PM
I'd just use inline CSS personally, or add it to the headinclude template. Not allowing proper CSS addition via plugins is a pretty chronic oversight in my eyes on Jelsoft's part.