XF 2.0 [CSS] How can I select body data-template = "" to change elements only for a single template?


Well-known member
I want to remove node-stats from forum_list and I think I can do something like this

@body: data-template='forum_list' .node-stats {display:none}

What is the correct code to do this? Thank you !

<body data-template="forum_list">
.. <div class="node-stats">
This page is useful for learning about attribute selectors: https://css-tricks.com/almanac/selectors/a/attribute/
Is there a negative data-attribute selector?

I tried both 「[data-template]:not([data-template='value'])」 and 「[data-template!='value']」, neither of them work.
(The second one even triggers LESS compilation error.)


Update: I found that it can only be used with 「body」 because that's how XF2 default HTML templates are written.
I tried to use this conditioner with specific element but failed.
Last edited:
Top Bottom