Sha256: b01ca14b44c010a6f39d6d68b6edf570af87c1db5e86f860ac9dce001b1edd90

Contents?: true

Size: 873 Bytes

Versions: 26

Compression:

Stored size: 873 Bytes

Contents

'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var postcss = _interopDefault(require('postcss'));

const selectorRegExp = /:blank([^\w-]|$)/gi;
var postcss$1 = postcss.plugin('css-blank-pseudo', opts => {
  const replaceWith = String(Object(opts).replaceWith || '[blank]');
  const preserve = Boolean('preserve' in Object(opts) ? opts.preserve : true);
  return root => {
    root.walkRules(selectorRegExp, rule => {
      const selector = rule.selector.replace(selectorRegExp, ($0, $1) => {
        return `${replaceWith}${$1}`;
      });
      const clone = rule.clone({
        selector
      });

      if (preserve) {
        rule.before(clone);
      } else {
        rule.replaceWith(clone);
      }
    });
  };
});

module.exports = postcss$1;
//# sourceMappingURL=postcss.js.map

Version data entries

26 entries across 25 versions & 8 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.18.0 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.18.2 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.16.1 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.15.2 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.18.4 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.18.1 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.14.0 test/dummy/node_modules/css-blank-pseudo/postcss.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/css-blank-pseudo/postcss.js
tang-0.2.1 spec/tang_app/node_modules/css-blank-pseudo/postcss.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/css-blank-pseudo/postcss.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/css-blank-pseudo/postcss.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/css-blank-pseudo/postcss.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/css-blank-pseudo/postcss.js
tang-0.2.0 spec/tang_app/node_modules/css-blank-pseudo/postcss.js
tang-0.1.0 spec/tang_app/node_modules/css-blank-pseudo/postcss.js
tang-0.0.9 spec/tang_app/node_modules/css-blank-pseudo/postcss.js
enju_library-0.3.8 spec/dummy/node_modules/css-blank-pseudo/postcss.js
jester-data-8.0.0 node_modules/css-blank-pseudo/postcss.js