XF 2.1 How to make certain prefix changes background colour?

Martyn

Active member
I have a prefex called "Approved" isnt it possible to make this change the background of the whole thread to stand out a little more?

for example like this?

1571760747843.webp
 
think thats for making the colours of the prefix a different colour? don't see it talk about making the thread change colour too??/

its currently like this
1571761099832.webp
ideally when a thread is approved, it would change the colour of the whole thread, making it stand out more?
1571761138903.webp

Thought I remember seeing something, but unable to find it via searching
 
Ahh, I missed it was for the thread.

I'm on my tablet so can't check the code but you can likely use the prefix ID in extra.less.

Press F12 for the browser inspector to check the CSS.
 
.LESS code for example
Less:
.structItem--thread
{
    &.is-prefix{your_prefix_id}
    {
        background: {your_background};
    }
}
so

am struggling?
Code:
.structItem--thread
{
    &.is-prefix{1}
    {
        background: #FFF;
    }
}

tried prefix id with and without the {} guess it means ID as in number? not the name?

which place to stick it? tried core.less/extra.less
 
Yes, in the extra.less template.

You will need to add the specific ID for that prefix.

Note that if you are using a custom style, the default CSS may not work - you would need to contact the author of the style in that case.
 
  • Like
Reactions: 021
Hmmm
one of these addons are stopping it working.. isn't the custom theme/addons for it as I disabled it, yet it worked on a test installed of Xenforo with the custom theme installed (on default theme)

christ, why is nothing ever simple??? >.<

1571783326754.webp
 
Are you using the default prefix colors or setting a custom class? If you're using the default colors... you'll need different CSS:

Code:
.structItem .label.label--blue {
    background-color: rgb(255, 0, 0);
    color: rgb(255, 255, 255);
    border: 1px solid rgb(0, 128, 0);
}

Something like that would change the blue prefix (assuming you have the blue selected which I assume you do).
 
Top Bottom