XF 2.2 identify style in css

RalleRalle

Active member
can't find the name of the current style in the html-code? I was sure you'd have it as a class in <body> like <body class="dark">.

I would like to have a dark style as a child to my default style. How can I have css-rules depending on which style the user has chosen?
I know I can solve this by customizing the extra.less in the child, but then I have two extra.less templates I have to fiddle around with. I am used to do this in one css sheet like:

CSS:
.thread_view.light h4.message-name { color:#000; }
.thread_view.dark h4.message-name { color:#FFF; }

with "light" and "dark" being the name of the light an dark style the user can choose from.

No way to do this with xenforo, right?
Thank you
 
Last edited:
Solution
This should work:

Code:
.message-userDetails .message-name a
{
    color: #000;
    & when (@xf-styleType = dark) { color: #FFF; }
}

.thread_view would only work on a basic forum post and not the other node types so I used a little less specific selector (.message-userDetails)
This should work:

Code:
.message-userDetails .message-name a
{
    color: #000;
    & when (@xf-styleType = dark) { color: #FFF; }
}

.thread_view would only work on a basic forum post and not the other node types so I used a little less specific selector (.message-userDetails)
 
Solution
Back
Top Bottom