XF 2.3 Colored Username everywhere

Devilwillcry4you

Active member
I have looked and seen some that are deleted or no longer available. I remember one that you used to have edit a bunch of templates but can't seem to find that anywhere.
 
It's because it was moved to User groups' (admin.php?user-groups/ Username CSS.

CSS:
color: green;

Will get you:

1734141798661.webp

Unfortunately, it doesn't apply to tags. But, that can also be a good thing with styles varying in colors, and even style variants. Though, if tags came with a class other than username (such as usergroup or another identifier), it'd be easy to implement. It still might be, but I couldn't figure it out.

1734141766094.webp
 
I was able to get that thank you, I was also looking to change the color on main index as well.
I played around with it more... You would have to do it user by user.

Easy edit of extra.less
CSS:
[data-user-id="2"], [data-user-id="1"] {
    color: green;
}

Will change users 1 and 2 to green.

1734148612682.webp

But, that doesn't account for style variations.

1734148662939.webp

A little more advanced LESS... To get it to change between the seen dark version and light version to this:

1734148795731.webp

CSS:
[data-user-id="2"], [data-user-id="1"] {
    .m-colorScheme(light,
        {
            color: green;
        }
    );
    .m-colorScheme(dark,
        {
            color: #00ff33;
        }
    );
}

But, you still have this problem on dark (as you're limited to CSS and not LESS in User groups):
1734148878628.webp

So you'll need to know the class that user group made (inspect). In this case, it's username--style3 where 3 represents the user group (3 = Administrative)

And do this:
CSS:
.username--style3 {
    .m-colorScheme(light,
        {
            color: green;
        }
    );
    .m-colorScheme(dark,
        {
            color: #00ff33;
        }
    );
}

For this:
1734149139138.webp
 
This might what you are looking for

2.2 so wouldn't account for style variations (light/dark mode) as seen above (possibly), but something to try.

I don't like relying on add ons as it's harder to maintain functionality when can be as simple as a style edit. What happens when 2.4 comes out? The style will likely work, whereas the add on might have breaking functionality, especially if you do a PHP update or something. That said, it is MIT, so someone could update it and repost it for it to function with 2.3 style variations, if it doesn't already.
 
Back
Top Bottom