Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
814 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
---|
4 |
|
---|
5 | var postcss = _interopDefault(require('postcss'));
|
---|
6 |
|
---|
7 | const gapPropertyRegExp = /^(column-gap|gap|row-gap)$/i;
|
---|
8 | var index = postcss.plugin('postcss-gap-properties', opts => {
|
---|
9 | const preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;
|
---|
10 | return root => {
|
---|
11 | // for each shorthand gap, column-gap, or row-gap declaration
|
---|
12 | root.walkDecls(gapPropertyRegExp, decl => {
|
---|
13 | // insert a grid-* fallback declaration
|
---|
14 | decl.cloneBefore({
|
---|
15 | prop: `grid-${decl.prop}`
|
---|
16 | }); // conditionally remove the original declaration
|
---|
17 |
|
---|
18 | if (!preserve) {
|
---|
19 | decl.remove();
|
---|
20 | }
|
---|
21 | });
|
---|
22 | };
|
---|
23 | });
|
---|
24 |
|
---|
25 | module.exports = index;
|
---|
26 | //# sourceMappingURL=index.cjs.js.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.