Pass a variable to <xen:require css="" />?


Well-known member
It is possible to pass a variable into <xen:require css="" /> statement?

For example in CSS template I have something like this:

.selector { width: {$myVar}px; }

In container template I would like to have something like this:

<xen:require css="my.css"><xen:set var="$myVar" value="50" /></xen:require>

It works with <xen:include /> but it does not with <xen:require />. Maybe there is a proper way of doing it?
You can't access dynamic variables in CSS like that. You would either need to inline the CSS or consider using CSS attr()'s, though there's limits with what you can do.
Top Bottom