XF 2.2 Custom CSS for prefixes

nicodak

Well-known member
Hello,

I CSSed title of every pages with this
Less:
.p-title-value {
    font-size: 26px;
    font-weight: 400;
    color: rgb(242, 94, 35);
    }
And i create custom CSS for some prefixes, like this
Less:
.php {
    font-size: 80%;
    background: rgb(240, 0, 114);
    padding : 0 5px;
    border-radius: 2px;
}
a .php {
    color: white;
}
Works fine except when the prefixe is displayed with the thread title, the prefixe text is colored with the color of the thread title rgb(242, 94, 35)
I missing something ? This behaviour doesn't occur with original prefixes.

Thanks ! :)
 

Brogan

XenForo moderator
Staff member
I have found this is the easiest way to create new prefix styling.


It's not ideal as it involves editing a core less template, which should generally be avoided, but it ensures it works throughout the site and behaves exactly like a core prefix style.
 

nicodak

Well-known member
I have found this is the easiest way to create new prefix styling.
So the native feature to set a custom css for a prefix is bugged ? You cannot set a text color for the prefix because it will be overrided by the page title color ?

Or maybe this part of code is badly written ?
CSS:
a .php {
    color: white;
}
But without it you can't set color to the prefix text.
Put the color attribut in the code below doesn't change the text color
CSS:
.php {
    font-size: 80%;
    color: white;
    background: rgb(240, 0, 114);
    padding : 0 5px;
    border-radius: 2px;
}

Thanks
 
Top