You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
484B

  1. const sass = require('sass');
  2. console.log("Hello there")
  3. sass.render({file: 'view/sass/main.scss'}, (err, res) => {
  4. if (err){
  5. console.log(err);
  6. return;
  7. }
  8. console.log(res.css.toString());
  9. let style = document.createElement('style');
  10. style.innerHTML = res.css.toString();
  11. let head = document.getElementsByTagName('head');
  12. if (head.length > 0)
  13. head = head[0]; // There should really only be one head... we're not a hydra!!!
  14. head.appendChild(style);
  15. });