source: trip-planner-front/node_modules/stylehacks/dist/plugins/leadingStar.js@ 8d391a1

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

initial commit

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[6a3a178]1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _plugin = _interopRequireDefault(require("../plugin"));
9
10var _browsers = require("../dictionary/browsers");
11
12var _identifiers = require("../dictionary/identifiers");
13
14var _postcss = require("../dictionary/postcss");
15
16function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18const hacks = '!_$_&_*_)_=_%_+_,_._/_`_]_#_~_?_:_|'.split('_');
19
20var _default = (0, _plugin.default)([_browsers.IE_5_5, _browsers.IE_6, _browsers.IE_7], [_postcss.ATRULE, _postcss.DECL], function (node) {
21 if (node.type === _postcss.DECL) {
22 // some values are not picked up by before, so ensure they are
23 // at the beginning of the value
24 hacks.some(hack => {
25 if (!node.prop.indexOf(hack)) {
26 this.push(node, {
27 identifier: _identifiers.PROPERTY,
28 hack: node.prop
29 });
30 return true;
31 }
32 });
33 let {
34 before
35 } = node.raws;
36
37 if (!before) {
38 return;
39 }
40
41 hacks.some(hack => {
42 if (~before.indexOf(hack)) {
43 this.push(node, {
44 identifier: _identifiers.PROPERTY,
45 hack: `${before.trim()}${node.prop}`
46 });
47 return true;
48 }
49 });
50 } else {
51 // test for the @property: value; hack
52 let {
53 name
54 } = node;
55 let len = name.length - 1;
56
57 if (name.lastIndexOf(':') === len) {
58 this.push(node, {
59 identifier: _identifiers.PROPERTY,
60 hack: `@${name.substr(0, len)}`
61 });
62 }
63 }
64});
65
66exports.default = _default;
67module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.