PHP in Assets to use variables in CSS

I would like to use variables in my css without having to compile with less or sass. So I thought of making my css a php file with variables. However that php file is pulished to the assets directory, but it is not executed

Any ideas how I can get this working ?

Another solution might be on the fly on the server compiling before going to the assets folder… Any suggestions?

In a view you can, for example


$this->registerCss("p {margin-top: {$n}px");

Thanks … but I would actually like the variables to be inside the CSS

So it is easy to have all the colors the same (instead of copying the values

Found 2 converters

Testing : nizsheanez

The parsing works correctly, but the result of my page includes:

link href="/css/basics_narrow.css

instead of

link href="/assets/6eff699c/css/basics_narrow.css

Any ideas?

The compiled file is correctly in the assets file (also the scss file is copied in the assets folder)

The only way I can fix this now is to do:

    'css/basics_narrow.scss', // force the parsing into css


    'css/basics_narrow.css', // load the actual parsed css

This results ofcourse in

<link href="/css/basics_narrow.css" rel="stylesheet">

<link href="/assets/6eff699c/css/basics_narrow.css" rel="stylesheet">

I hope to find a better way… any suggestions ?