The issue is on Symfony 5, but I guess it can be a general issue for the communication between php and css.
First, let me say that I'm not sure this kind of thing is possible, probably but I don't know for sure, so let me know if there is some libraries that you might know to handle this kind of things
Let's say I have a simple test.html page with this code.
<div class="test">Test text</div>
I simplified but of course you also have an import from a test.css
From my Symfony Controller when I will hit my /test
url, I will redirect to this test.html
page with a variable marginleft
that could contain a value like 100px
for example purpose.
So the question is, do I have a way to dynamically load my css using the php variable ?
To be more specific, I'm not speaking about using some javascript workaround to change the css class content when I load the page. What I am looking for is directly to load my test.css
using php variables.
In other words, I would like to do something like this :
.test{
margin-left : {{marginleft}}
}
My main goal here is to provide a almost full css customization of elements from a page for my users that's why I don't want to just change defaults elements with javascript.
Thanks for your assistance.