ElkArte Community

Elk Development => Theme development => Topic started by: Wizard on October 12, 2015, 06:25:52 am

Title: How to add a new css file into theme ?
Post by: Wizard on October 12, 2015, 06:25:52 am
I have a custom.css file ( 3rd party ) which I need to include in Silk theme. I have custom_silk.css there already. How can I add the new style sheet into the template. And to which template should I add ?
Title: Re: How to add a new css file into theme ?
Post by: Flavio93Zena on October 12, 2015, 10:45:11 am
Code: [Select]
<link rel="stylesheet" href="path_to_css($themedir and then subfolder)/custom_silk.css" type="text/css">
And into index.template.php, in the head section ;)
Title: Re: How to add a new css file into theme ?
Post by: Wizard on October 13, 2015, 04:56:57 am
Thank you @Flavio93Zena
Title: Re: How to add a new css file into theme ?
Post by: emanuele on October 13, 2015, 08:26:53 am
It's almost the same as adding a new js file:
Code: [Select]
loadCSSFile('filename.css');
in template_init. ;)
Title: Re: How to add a new css file into theme ?
Post by: Flavio93Zena on October 13, 2015, 12:19:24 pm
:o ?
Title: Re: How to add a new css file into theme ?
Post by: Wizard on October 13, 2015, 12:26:47 pm
@Flavio93Zena , @Spuds  suggested me that way of adding css file into theme. It worked as well. Yours, I guess is an alternative way.
Title: Re: How to add a new css file into theme ?
Post by: Flavio93Zena on October 13, 2015, 12:33:44 pm
Yeah mine is old school... I guess those crazy guys created new ways to add stuff ;D Nice one! Glad it was working though ahah