YesNoOk
  1. Welcome!
    EosAlpha BBS is a fork of the popular Simple Machines Forum software. We aim at creating a new forum software, adding several new features and a modern and fresh design on top of the existing SMF code base.

    This software is currently in an early stage of development and this forum acts primarily as a testing platform for the ongoing development.

    Feel free to look around to get an idea about how it feels and looks.
avatar

Planned changes in how membergroup colors are handled (Read 1349 times)

Started by Nightwish, August 03, 2012, 14:41:50

0 Members and 1 Guest are viewing this.
Share this topic:
#1
Planned changes in how membergroup colors are handled |
August 03, 2012, 14:41:50
In SMF, member groups can have a color assigned by defining a html color code for the group.

While this is fine in most cases, it has one particular problem: What if you have 2 different themes, say one with a very bright and another one with a dark background? The member group colors that are looking good on the bright theme may totally fail on the dark one (or vice versa).

Solution? Do away with the static colors and let do CSS the magic. Instead of using static style="color:xxx" attributes, CSS classes will be used for member links, so a member link will look like this:
Code: (html)
<a class="member group_#">Membername</a>
Where # is the numeric id of the member's primary group (or group id of his post-based group, if he wasn't assigned a primary one).

In the theme's style sheet it's then just a matter of defining additional CSS classes for non-standard member groups.
Code: (css)
a.member.group_1 {
  color:red;
  font-weight:bold;   /* evil admin will always appear in red and bold */
}
and so on.

I think this is more flexible than having static member colors because it also allows member group to have custom fonts or basically anything that can be done via CSS.
__
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to a single instruction that doesn't work.
My SMF-based forum fork