source: trip-planner-front/node_modules/postcss-overflow-shorthand/node_modules/postcss/lib/rule.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 8.5 KB
Line 
1"use strict";
2
3exports.__esModule = true;
4exports.default = void 0;
5
6var _container = _interopRequireDefault(require("./container"));
7
8var _list = _interopRequireDefault(require("./list"));
9
10function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
13
14function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
15
16function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
17
18/**
19 * Represents a CSS rule: a selector followed by a declaration block.
20 *
21 * @extends Container
22 *
23 * @example
24 * const root = postcss.parse('a{}')
25 * const rule = root.first
26 * rule.type //=> 'rule'
27 * rule.toString() //=> 'a{}'
28 */
29var Rule = /*#__PURE__*/function (_Container) {
30 _inheritsLoose(Rule, _Container);
31
32 function Rule(defaults) {
33 var _this;
34
35 _this = _Container.call(this, defaults) || this;
36 _this.type = 'rule';
37 if (!_this.nodes) _this.nodes = [];
38 return _this;
39 }
40 /**
41 * An array containing the rule’s individual selectors.
42 * Groups of selectors are split at commas.
43 *
44 * @type {string[]}
45 *
46 * @example
47 * const root = postcss.parse('a, b { }')
48 * const rule = root.first
49 *
50 * rule.selector //=> 'a, b'
51 * rule.selectors //=> ['a', 'b']
52 *
53 * rule.selectors = ['a', 'strong']
54 * rule.selector //=> 'a, strong'
55 */
56
57
58 _createClass(Rule, [{
59 key: "selectors",
60 get: function get() {
61 return _list.default.comma(this.selector);
62 },
63 set: function set(values) {
64 var match = this.selector ? this.selector.match(/,\s*/) : null;
65 var sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
66 this.selector = values.join(sep);
67 }
68 /**
69 * @memberof Rule#
70 * @member {string} selector The rule’s full selector represented
71 * as a string.
72 *
73 * @example
74 * const root = postcss.parse('a, b { }')
75 * const rule = root.first
76 * rule.selector //=> 'a, b'
77 */
78
79 /**
80 * @memberof Rule#
81 * @member {object} raws Information to generate byte-to-byte equal
82 * node string as it was in the origin input.
83 *
84 * Every parser saves its own properties,
85 * but the default CSS parser uses:
86 *
87 * * `before`: the space symbols before the node. It also stores `*`
88 * and `_` symbols before the declaration (IE hack).
89 * * `after`: the space symbols after the last child of the node
90 * to the end of the node.
91 * * `between`: the symbols between the property and value
92 * for declarations, selector and `{` for rules, or last parameter
93 * and `{` for at-rules.
94 * * `semicolon`: contains `true` if the last child has
95 * an (optional) semicolon.
96 * * `ownSemicolon`: contains `true` if there is semicolon after rule.
97 *
98 * PostCSS cleans selectors from comments and extra spaces,
99 * but it stores origin content in raws properties.
100 * As such, if you don’t change a declaration’s value,
101 * PostCSS will use the raw value with comments.
102 *
103 * @example
104 * const root = postcss.parse('a {\n color:black\n}')
105 * root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
106 */
107
108 }]);
109
110 return Rule;
111}(_container.default);
112
113var _default = Rule;
114exports.default = _default;
115module.exports = exports.default;
116//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGUuZXM2Il0sIm5hbWVzIjpbIlJ1bGUiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsImxpc3QiLCJjb21tYSIsInNlbGVjdG9yIiwidmFsdWVzIiwibWF0Y2giLCJzZXAiLCJyYXciLCJqb2luIiwiQ29udGFpbmVyIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBOztBQUNBOzs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7O0lBV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