Skip to content

Commit c374d4d

Browse files
authored
fix postcss 8.2.x compat (#148)
* fix postcss 8.2.x compat * add link to issue * merge
1 parent 7f77b10 commit c374d4d

File tree

9 files changed

+28
-7
lines changed

9 files changed

+28
-7
lines changed

experimental/css-has-pseudo/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const creator: PluginCreator<{ preserve?: boolean, specificityMatchingName?: str
7171
if (options.preserve) {
7272
rule.cloneBefore({ selectors: selectors });
7373
} else {
74-
rule.assign({ selectors: selectors });
74+
rule.selectors = selectors;
7575
}
7676
},
7777
};

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/css-has-pseudo/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes to CSS Has Pseudo
22

3+
### Unreleased
4+
5+
- Fix compatibility with PostCSS `v8.2.x` [#147](https://github.com/csstools/postcss-plugins/issues/147)
6+
7+
This version is not officially supported but some tool providers pinned PostCSS to `v8.2.x`,
8+
making it impossible for end users to have a working setup.
9+
310
### 3.0.2 (January 2, 2022)
411

512
- Removed Sourcemaps from package tarball.

plugins/css-has-pseudo/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const creator = (/** @type {{ preserve: true | false }} */ opts) => {
5353
if (shouldPreserve) {
5454
rule.cloneBefore({ selector: modifiedSelector });
5555
} else {
56-
rule.assign({ selector: modifiedSelector });
56+
rule.selector = modifiedSelector;
5757
}
5858
},
5959
};

plugins/postcss-dir-pseudo-class/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes to PostCSS Dir Pseudo Class
22

3+
### Unreleased
4+
5+
- Fix compatibility with PostCSS `v8.2.x` [#147](https://github.com/csstools/postcss-plugins/issues/147)
6+
7+
This version is not officially supported but some tool providers pinned PostCSS to `v8.2.x`,
8+
making it impossible for end users to have a working setup.
9+
310
### 6.0.2 (January 2, 2022)
411

512
- Removed Sourcemaps from package tarball.

plugins/postcss-dir-pseudo-class/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ module.exports = function creator(opts) {
153153
if (preserve) {
154154
rule.cloneBefore({ selector: modifiedSelector });
155155
} else {
156-
rule.assign({ selector: modifiedSelector });
156+
rule.selector = modifiedSelector;
157157
}
158158
},
159159
};

plugins/postcss-logical/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes to PostCSS Logical Properties
22

3+
### Unreleased
4+
5+
- Fix compatibility with PostCSS `v8.2.x` [#147](https://github.com/csstools/postcss-plugins/issues/147)
6+
7+
This version is not officially supported but some tool providers pinned PostCSS to `v8.2.x`,
8+
making it impossible for end users to have a working setup.
9+
310
### 5.0.2 (January 2, 2022)
411

512
- Removed Sourcemaps from package tarball.

plugins/postcss-logical/src/lib/clone-rule.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default (decl, dir) => {
55
raws: {},
66
}).removeAll() : postcss.rule({ selector: '&' });
77

8-
rule.assign({'selectors': rule.selectors.map(selector => `${selector}:dir(${dir})`)});
8+
rule.selectors = rule.selectors.map(selector => `${selector}:dir(${dir})`);
99

1010
return rule;
1111
};

plugins/postcss-logical/src/lib/transform-transition.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ export default (decl, notValues, dir, preserve) => {
4848
if (preserve) {
4949
decl.cloneBefore({});
5050
}
51-
decl.assign({ value: ltrValues.join('') });
51+
decl.value = ltrValues.join('');
5252
return;
5353
} else if (rtlValues.length && dir === 'rtl') {
5454
if (preserve) {
5555
decl.cloneBefore({});
5656
}
57-
decl.assign({ value: rtlValues.join('') });
57+
decl.value = rtlValues.join('');
5858
return;
5959
} else if (ltrValues.join('') !== rtlValues.join('')) {
6060

0 commit comments

Comments
 (0)