XF 1.4 Accessing custom field from EXTRA.css

I've been trying to set up a system where the site font is replaced from a custom field, but $visitor seems to be null inside EXTRA.css. What am I doing wrong?

I've tested using the dumper: {xen:helper dump, $visitor} produces "<pre>NULL

The idea is to apply the font globally using this css:

* {
font-family: '{$visitor.customFields.font}', sans-serif !important;

I know it's dirty but we have like 8 themes and the font is defined everywhere multiple times, so I went with this hack.

site: new-game-plus.com


XenForo developer
Staff member
You simply can't do that. Visitor information is not available in CSS. You would need to define that CSS inline with the page.
Hmm, I thought it would be something like that.

Instead of having it user-selectable I just set it in the theme and made selectable themes. After erasing font properties on lots of places, it seems to be correctly inheriting them from Body.

Thanks! Everything is working fine now.