Posts: 1,247
Threads: 82
Joined: Feb 2011
Is it possible to call certain css via a component in the template? I tried it quickly, but didn't seem to work.
It might be interesting if you have for example certain specific css for plugins which would work with multiple themes. then you just set the component code in every theme and then you can just change only the component, knowing it will change css for every theme.
Ok this might be a crazy idea...
Posts: 6,266
Threads: 181
Joined: Sep 2011
You can using jquery if includes in your template, or plain javascript but its a bit harder.
$('#elementID').addClass(''classname);
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2013-10-05, 08:02:55)datiswous Wrote: Is it possible to call certain css via a component in the template? I tried it quickly, but didn't seem to work.
Where would be those css files? Or would styles be directly editable in the component?
Posts: 3,491
Threads: 106
Joined: Mar 2010
Code:
<style type="text/css">
/* ... common styles, if any ... */
<?php
global $TEMPLATE;
switch($TEMPLATE) {
case 'Innovation': ?>
/* ... styles for innov. ... */
<?php break;
case 'Cardinal': ?>
/* ... styles for cardinal ... */
<?php break;
case 'GSkeleton': ?>
/* ... styles for gskelet. ... */
<?php break;
default: ?>
/* ... default styles ... */
<?php } ?>
</style>
Posts: 6,266
Threads: 181
Joined: Sep 2011
Oh include css, yeah there needs to be a location to put theme outside the theme i would imagine.
I have done this via components, you insert the style tags, although you really should not put them in the middle of a document.
You are better off just always including the css, and having your selectors properly setup.