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.

scss-stringifier.js 6.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. "use strict";
  2. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  3. var Stringifier = require('postcss/lib/stringifier');
  4. var ScssStringifier =
  5. /*#__PURE__*/
  6. function (_Stringifier) {
  7. _inheritsLoose(ScssStringifier, _Stringifier);
  8. function ScssStringifier() {
  9. return _Stringifier.apply(this, arguments) || this;
  10. }
  11. var _proto = ScssStringifier.prototype;
  12. _proto.comment = function comment(node) {
  13. var left = this.raw(node, 'left', 'commentLeft');
  14. var right = this.raw(node, 'right', 'commentRight');
  15. if (node.raws.inline) {
  16. var text = node.raws.text || node.text;
  17. this.builder('//' + left + text + right, node);
  18. } else {
  19. this.builder('/*' + left + node.text + right + '*/', node);
  20. }
  21. };
  22. _proto.decl = function decl(node, semicolon) {
  23. if (!node.isNested) {
  24. _Stringifier.prototype.decl.call(this, node, semicolon);
  25. } else {
  26. var between = this.raw(node, 'between', 'colon');
  27. var string = node.prop + between + this.rawValue(node, 'value');
  28. if (node.important) {
  29. string += node.raws.important || ' !important';
  30. }
  31. this.builder(string + '{', node, 'start');
  32. var after;
  33. if (node.nodes && node.nodes.length) {
  34. this.body(node);
  35. after = this.raw(node, 'after');
  36. } else {
  37. after = this.raw(node, 'after', 'emptyBody');
  38. }
  39. if (after) this.builder(after);
  40. this.builder('}', node, 'end');
  41. }
  42. };
  43. _proto.rawValue = function rawValue(node, prop) {
  44. var value = node[prop];
  45. var raw = node.raws[prop];
  46. if (raw && raw.value === value) {
  47. return raw.scss ? raw.scss : raw.raw;
  48. } else {
  49. return value;
  50. }
  51. };
  52. return ScssStringifier;
  53. }(Stringifier);
  54. module.exports = ScssStringifier;
  55. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3Mtc3RyaW5naWZpZXIuZXM2Il0sIm5hbWVzIjpbIlN0cmluZ2lmaWVyIiwicmVxdWlyZSIsIlNjc3NTdHJpbmdpZmllciIsImNvbW1lbnQiLCJub2RlIiwibGVmdCIsInJhdyIsInJpZ2h0IiwicmF3cyIsImlubGluZSIsInRleHQiLCJidWlsZGVyIiwiZGVjbCIsInNlbWljb2xvbiIsImlzTmVzdGVkIiwiYmV0d2VlbiIsInN0cmluZyIsInByb3AiLCJyYXdWYWx1ZSIsImltcG9ydGFudCIsImFmdGVyIiwibm9kZXMiLCJsZW5ndGgiLCJib2R5IiwidmFsdWUiLCJzY3NzIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLElBQUlBLFdBQVcsR0FBR0MsT0FBTyxDQUFDLHlCQUFELENBQXpCOztJQUVNQyxlOzs7Ozs7Ozs7OztTQUNKQyxPLG9CQUFTQyxJLEVBQU07QUFDYixRQUFJQyxJQUFJLEdBQUcsS0FBS0MsR0FBTCxDQUFTRixJQUFULEVBQWUsTUFBZixFQUF1QixhQUF2QixDQUFYO0FBQ0EsUUFBSUcsS0FBSyxHQUFHLEtBQUtELEdBQUwsQ0FBU0YsSUFBVCxFQUFlLE9BQWYsRUFBd0IsY0FBeEIsQ0FBWjs7QUFFQSxRQUFJQSxJQUFJLENBQUNJLElBQUwsQ0FBVUMsTUFBZCxFQUFzQjtBQUNwQixVQUFJQyxJQUFJLEdBQUdOLElBQUksQ0FBQ0ksSUFBTCxDQUFVRSxJQUFWLElBQWtCTixJQUFJLENBQUNNLElBQWxDO0FBQ0EsV0FBS0MsT0FBTCxDQUFhLE9BQU9OLElBQVAsR0FBY0ssSUFBZCxHQUFxQkgsS0FBbEMsRUFBeUNILElBQXpDO0FBQ0QsS0FIRCxNQUdPO0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