2013-04-28, 11:33 PM
I posted this on GitHub a few days back, then I realised it was probably smarter to post it here.
IMO, MyBB should implement LESS support into the theme editor, even if it's like the code that Euan posted here where it gets transformed into pure CSS on commit.
Should be beneficial to theme authors, especially if it is transformed into CSS - that makes it easier for the end user to understand, instead of staring at a foreign syntax. Of course, if the user doesn't know what LESS is, they can simply use CSS.
Of course, one problem I encountered (and haven't fixed yet) is that variables don't get carried over sessions, so saving and reopening the stylesheet will cause variables to be parsed and lost.
What do you think? I tested it, adding in support on Stylesheet Creation and Editing only took about six lines of code, plus an extra file (the lessc.inc.php Euan posted).
IMO, MyBB should implement LESS support into the theme editor, even if it's like the code that Euan posted here where it gets transformed into pure CSS on commit.
Should be beneficial to theme authors, especially if it is transformed into CSS - that makes it easier for the end user to understand, instead of staring at a foreign syntax. Of course, if the user doesn't know what LESS is, they can simply use CSS.
Of course, one problem I encountered (and haven't fixed yet) is that variables don't get carried over sessions, so saving and reopening the stylesheet will cause variables to be parsed and lost.
What do you think? I tested it, adding in support on Stylesheet Creation and Editing only took about six lines of code, plus an extra file (the lessc.inc.php Euan posted).