Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

LessStringifier.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const Stringifier = require('postcss/lib/stringifier');
  2. module.exports = class LessStringifier extends Stringifier {
  3. atrule(node, semicolon) {
  4. if (!node.mixin && !node.variable && !node.function) {
  5. super.atrule(node, semicolon);
  6. return;
  7. }
  8. const identifier = node.function ? '' : node.raws.identifier || '@';
  9. let name = `${identifier}${node.name}`;
  10. let params = node.params ? this.rawValue(node, 'params') : '';
  11. const important = node.raws.important || '';
  12. if (node.variable) {
  13. params = node.value;
  14. }
  15. if (typeof node.raws.afterName !== 'undefined') {
  16. name += node.raws.afterName;
  17. } else if (params) {
  18. name += ' ';
  19. }
  20. if (node.nodes) {
  21. this.block(node, name + params + important);
  22. } else {
  23. const end = (node.raws.between || '') + important + (semicolon ? ';' : '');
  24. this.builder(name + params + end, node);
  25. }
  26. }
  27. comment(node) {
  28. if (node.inline) {
  29. const left = this.raw(node, 'left', 'commentLeft');
  30. const right = this.raw(node, 'right', 'commentRight');
  31. this.builder(`//${left}${node.text}${right}`, node);
  32. } else {
  33. super.comment(node);
  34. }
  35. }
  36. };