Compile CSS / SCSS

Author Posts

adkoen

Heads up! this post was created when Microthemer was at version 6. The current version is 7. Some references to the interface may be out of date.

Hi Sebastian,
would there be a way I can tell Microthemer to recompile the SCSS from code? I don’t need you to dig in deep, just wondered if there was an easy way from inside my own plugin. Maybe a method I can call?
thanks!
Koen.


Sebastian

Hey Koen,

MT now runs the Sass compilation in the browser using a JS library. There is currently still a server side option, but that PHP library will be removed in future. So for function calls, you would need to trigger an MT JavaScript function. Does your plugin run in the browser alongside MT? If so you could try running:

window.TvrMT.TvrUi.sass.compile('sass code string', function(result) {
   console.log('The compiled CSS', result);
});

adkoen

Hey Sebastian,
I’m not sure if I’ll get this to work but at least now I know what to look for and I’m going to dig in!
Thank you.


Sebastian

OK, good luck Koen!

You must login or register to reply to this topic.