Hey there! I'm trying to set up an extension for Flarum and would like to edit several aspects of its main css (thus not doable in the admin section of edit CSS).

I have set up (new Extend\Frontend('forum'))->css('/less/forum.less'), in my extend.php settings, but even though everything seems ok, when I try to set container's backgroundcolor to "red" to see if it works, nothing happens.

Is there something else I have to do to extend flarum that is preventing me from using the specified .less file?

Thanks!

    luceos
    .container {
    background-color: red ;
    }

    This is just for testing purposes, but it doesnt seem to work.

    gabrielroco are you sure about the file path? ->css('/less/forum.less') would load a file from the absolute path /less/forum.less. To load relative to the location of extend.php, you can use ->css(__DIR__ . '/less/forum.less').

    If the path is wrong there should be a "File not found at path <path>" error though.

    To test out your changes you should set 'debug' => true in config.php. This will force Flarum to re-compile the Less everytime the forum is opened. In production where debug should be false, you need to clear Flarum's cache to have the Less recompiled.

    You were absolutely right, file path couldn't be relative for some reason (I'm guessing simple misunderstanding on how relative paths work from my part). Fixed by giving it the absolute path to my file and trying again.

    For everyone else reading: having 'debug' => true is fundamental since php flarum cache:clear its obnoxious after a while. But dont forget to turn it back off if on production.