MyBB Community Forums

Full Version: [Tutorial] How to have different username styles for each theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is something one or two people have asked and might be a neat tutorial.

You may have several themes installed, some light, some dark, and it may be hard to find enough colours to use so that all groups have a different colour, that you can see against the background of your theme. Luckily, it's simple to have a different username style depending on your theme.

If you put something like this in the Username Style option of the group settings, for the admin usergroup, for example...

<span class="admin">{username}</span>

... then you can add a class for the style of the admin group into the global.css for each theme.

This could be used on a dark theme...

.admin {
color: #FFFFFF;
font-weight: bold;
}

... and this could be used in a light theme...

.admin {
color: #000000;
font-weight: bold;
}

... obviously that's quite simple CSS, but hopefully you get the idea; you can simply add a class to global.css and make the style of the usernames use that class.
Very nice tutorial, Matt!
Im sure this will be useful for some people!
Oh My God!
Great one!
Maybe I'll need it one day.