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.

45 lines
984B

  1. const styles = require('../app/styles');
  2. async function start(){
  3. let style = null;
  4. try {
  5. style = await styles.render("main");
  6. } catch (err) {
  7. console.log(err);
  8. }
  9. if (style !== null){
  10. console.log(style);
  11. let e = document.createElement('style');
  12. e.innerHTML = style.css.toString();
  13. let head = document.getElementsByTagName('head');
  14. if (head.length > 0)
  15. head = head[0]; // There should really only be one head... we're not a hydra!!!
  16. head.appendChild(e);
  17. }
  18. }
  19. console.log("Kicking the pig!");
  20. start();
  21. /*
  22. sass.render({file: 'view/sass/main.scss'}, (err, res) => {
  23. if (err){
  24. console.log(err);
  25. return;
  26. }
  27. console.log(res.css.toString());
  28. let style = document.createElement('style');
  29. style.innerHTML = res.css.toString();
  30. let head = document.getElementsByTagName('head');
  31. if (head.length > 0)
  32. head = head[0]; // There should really only be one head... we're not a hydra!!!
  33. head.appendChild(style);
  34. });
  35. */