MyBB Community Forums

Full Version: How can I make a template's css change throughout themes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, I use the Dvz_shoutbox plugin, and it was assigned css for the main theme in the template file, how can I make it so the css part is different for each theme? To match.

My code in the template:
<style type="text/css">
.tablehead { padding: 5px 10px; border-radius: 5px 5px 0 0; font: 16px Arial, sans-serif; border: 0px solid rgb(230, 0, 27); }
.beauregard { padding: 5px 10px; border-radius: 5px 5px 0 0; font: 16px Arial, sans-serif; border: 1px solid rgb(230, 0, 27); }
.tablehead .right { float: right; margin: 0; padding-top: 1px; font-size:  13px; }
.tablehead a { color: #FFF !important; text-decoration: none; }
#shoutbox_data {border: 0px solid rgb(230, 0, 27); font: 13px Arial, sans-serif; }
#shoutbox { margin-bottom: 5px; }
#shoutbox .panel { padding: 2px; }
#shoutbox .panel-blocked { margin: 1px 0; padding: 5px; background: #FCEFEF; font-size: 11px; color: #543A3A; }
#shoutbox .panel-away { margin: 1px 0; padding: 5px;  background: #EDEDED; font-size: 11px; color: #7A7A7A; }
#shoutbox .panel-away button { margin-right: 5px; padding: 5px; font-family: Tahoma, sans-serif; color: #FFF; font-size: 11px; font-weight: bold; text-align: center; text-shadow: 0 -1px 0 #297318; border-radius: 5px; background: #962725; border: none; border-radius: 3px; }
#shoutbox .trow1 {  }
#shoutbox .panel-minposts { margin: 1px 0; padding: 5px; background: #FFFED8; font-size: 11px; color: #727250; }
img#dvz_sb_loading { position: relative; top: 3px; left: 5px; }
input#shout_text { margin-right: 2px; padding: 5px 6px 6px 6px; width: 90%; background: #FFF; border: 1px solid #898989; border-radius: 2px; font-family: Tahoma, sans-serif; font-size: 12px; color: #000; }
input#shout_button { padding: 5px; font-family: Tahoma, sans-serif; color: #FFF; font-size: 11px; font-weight: bold; text-align: center; text-shadow: 0 -1px 0 #297318; border-radius: 5px; background: #499338; border: solid 1px #499338; border-radius: 3px; }
#shoutbox .trow1 {  }
#shoutbox .trow2 {  }
.sbentry { padding: 0; }
#shoutbox .userdata { margin: 0; padding: 6px; float: left;  text-align: right; }
#shoutbox .text { margin: 0; padding: 6px; color: #333333; }
#shoutbox .insUser { cursor: pointer; color: #AAAAAA; }
#shoutbox .info { float: right; margin-top: 5px; margin-right: 5px; font-size: 11px; color: #888888; }
#shoutbox .info .date { margin-right: 5px; }
#shoutbox .info .ip { margin-right: 5px; color: #CECECE; }
#shoutbox .mod { padding: 2px 5px; background: #333333; border-radius: 3px; font-size: 10px; font-weight: bold; color: #FFF; text-decoration: none; }
#shoutbox .dvz_sb_del { background-color: #6B0100; }
#shoutbox img.avatar { float: left; display: inline-block; margin-top: -1px; margin-right: 5px; max-height: 16px; max-width: 16px; border: solid 1px #FFF; box-shadow: 0 0 2px #E0E0E0; }
</style>
<div class="beauregard">
<div class="tablehead">RSPUnit Shoutbox<p class="right"><a href="{$mybb->settings[bburl]}/index.php?action=shoutbox_archive">&laquo; {$lang->dvz_sb_archivelink}</a></p></div>
<hr style="color:  rgb(230, 0, 27);"/>
<div id="shoutbox">
<div class="panel-away" style="display:none"><button class="button" onclick="dvz_shoutbox.setBack()">{$lang->dvz_sb_away_button}</button>{$lang->dvz_sb_away}</div>
<div id="shoutbox_data" style="height:{$mybb->settings[dvz_sb_height]}px; overflow:auto;"></div>
{$dvz_shoutbox_panel}
</div>
</div>
<br/>

<script type="text/javascript" src="jscripts/dvz_shoutbox.js"></script>
<script>
now = new Date;
dvz_shoutbox.userLastAction = now.getTime();
dvz_shoutbox.interval = {$mybb->settings[dvz_sb_interval]};
dvz_shoutbox.antiflood = {$mybb->settings[dvz_sb_antiflood]};
dvz_shoutbox.maxShouts = {$mybb->settings[dvz_sb_num]};
dvz_shoutbox.awayTimeout = {$mybb->settings[dvz_sb_away]}*1000;
dvz_shoutbox.lang = ['{$lang->dvz_sb_delete_confirm}', '{$lang->dvz_sb_antiflood}'];
{$dvz_shoutbox_js}
dvz_shoutbox.checkForMessages();
</script>

[Image: sjqPZQE.png]

I want to assign that css via the global.css file, or a new .css file for the theme. (shoutbox.css) Can someone help me? Thanks. Toungue
Well, just copy the CSS and go to ACP -> Templates & Style -> [each theme] -> Add Stylesheet -> fill in the name (with .css at the end) and own content correctly -> Save -> edit to match.

Do it for each theme.
That style tag shouldn't really be in the template; the definitions should have been in a stylesheet. In addition to following Destroy666's advice, remove that style tag from the template.