Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
call css via component
#1
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...
Reply
#2
You can using jquery if includes in your template, or plain javascript but its a bit harder.

$('#elementID').addClass(''classname);
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(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?
Reply
#4
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>
Reply
#5
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)