MyBB Community Forums

Full Version: Would moving this bit of css to the global css cause a problem?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, I came across this bit of css in the member templates of a theme.. if I were to put this in the global css, will it still work as if it were in the member templates? I ask because I would want to keep all the css together so that it would make theming easier since it would all be in one place.. and I wouldn't have to remember which template I had to edit so that it would match the rest of the theme every time I make a new one.

.container2 {
			margin: 0 auto;
		}

		ul.tabs{
			margin: 0px;
			padding: 0px;
			list-style: none;
		}
		ul.tabs li{
			background: none;
			color: #fff;
			display: inline-block;
			padding: 10px 15px;
			cursor: pointer;
            background: #324e66;
            border: 1px solid #1a2936;
			border-bottom: none;
		}

		ul.tabs li.current{
			background: #fff;
			color: #222;
			border: 1px solid #e5e5e5;
			border-bottom: none;
		}

		.tab-content2{
			display: none;
			background: #fff;
			padding: 15px;
			border: 1px solid #e5e5e5;
		}

		.tab-content2.current{
			display: inherit;
		}
If the theme designer used ul.tabs in other areas of theme, it could cause the CSS in global.css to override the custom one. Therefore anything within your site that uses ul.tabs would be styled in the same way as the member profile which may disrupt other stylings used.

I imagine container2 is used as a separate entity as well so that could also cause problems. It's only a small amount of CSS. I'd play it safe and leave it where it is, or at least check to see if global.css or a CDN contains a ul.tabs class.
(2024-02-27, 09:02 AM)MattyWjeisz Wrote: [ -> ]If the theme designer used ul.tabs in other areas of theme, it could cause the CSS in global.css to override the custom one. Therefore anything within your site that uses ul.tabs would be styled in the same way as the member profile which may disrupt other stylings used.

I imagine container2 is used as a separate entity as well so that could also cause problems. It's only a small amount of CSS. I'd play it safe and leave it where it is, or at least check to see if global.css or a CDN contains a ul.tabs class.

Hi, thank you for the reply, I did check and it has only been mentioned there.

I am working on a new theme myself, and saw that the tabs stood out from the colors I was using for my theme and I couldn't find them in the global css, or in any of the others, but when I exported the theme, and looked in the xml file, it showed under member templates.

This was why I asked.
If it's only been mentioned in the member template then it should be fine to add to global.css Smile
Adding anythimg to global css never breaks functionality as it loads with every page.
Reason to keep other css files is to cutoff unwanted codes that are not required for the page to reduce resource size and fast loading of page with non-cached page requests.
Thank you for the help guys, I really appreciate it, is it ok if I re-use this topic for my questions regarding templates for this theme? It would help me keep track of all the info in one place.

I have currently having trouble with this..

This is the forumbit_depth1_cat template of the theme I am working on right now..

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead{$expthead}" colspan="4">
<div class="expcolimage"><img src="{$theme['imgdir']}/{$expcolimage}" id="cat_{$forum['fid']}_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div><strong><a href="{$forum_url}">{$forum['name']}</a></strong></div>
</td>
</tr>
</thead>
<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">
{$sub_forums}
</tbody>
</table>
<br>


--------------------------------------------------

This is the forumbit_depth1_cat template of the default MyBB theme I tweaked, so that the category description would show in the .tcat cell next to the ones that detail the number of topics and replies.

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead{$expthead}" colspan="5">
<div class="expcolimage"><img src="{$theme['imgdir']}/{$expcolimage}" id="cat_{$forum['fid']}_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div><strong><a href="{$forum_url}">{$forum['name']}</a></strong></div>
</td>
</tr>
</thead>
<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">
<tr>
<td class="tcat" colspan="2"><span class="smalltext"><strong>{$forum['description']}</strong></span></td>
<td class="tcat" width="85" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_threads}</strong></span></td>
<td class="tcat" width="85" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_posts}</strong></span></td>
<td class="tcat" width="200" align="center"><span class="smalltext"><strong>{$lang->forumbit_lastpost}</strong></span></td>
</tr>
{$sub_forums}
</tbody>
</table>
<br />

==============================

Where do I put this "{$forum['description']}" in the first code to get it to show like this on the theme I'm working on?

[Image: p2u4Bng.png]
Can you reshare the image? It's not showing up for me.
From that picture, the forum description would go here like this:

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead{$expthead}" colspan="4">
<div class="expcolimage"><img src="{$theme['imgdir']}/{$expcolimage}" id="cat_{$forum['fid']}_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div><strong><a href="{$forum_url}">{$forum['name']}</a></strong></div>
</td>
</tr>
<tr>
<td class="tcat">{$forum['description']}</td>
</tr>
</thead>
<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">
{$sub_forums}
</tbody>
</table>
<br>
Ok I added your code and this happened..

https://i.imgur.com/OxX9FQY.jpg
Pages: 1 2