Skip to content

Commit 844e062

Browse files
authored
browser polyfills : use window or self for the global polyfill (#586)
1 parent e5e0a76 commit 844e062

File tree

8 files changed

+36
-8
lines changed

8 files changed

+36
-8
lines changed

plugins/css-blank-pseudo/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to CSS Blank Pseudo
22

3+
### Unreleased
4+
5+
- Fix: assign global browser polyfill to `window`, `self` or a blank object.
6+
37
### 4.1.0 (July 30, 2022)
48

59
- Added: `disablePolyfillReadyClass` plugin option to prevent `.js-blank-pseudo` from being added.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
/* global self */
1+
/* global self,window */
22
import { default as cssBlankPseudoInit } from './browser';
3-
self.cssBlankPseudoInit = cssBlankPseudoInit;
3+
4+
(function (global) {
5+
global.cssBlankPseudoInit = cssBlankPseudoInit;
6+
}('object' === typeof window && window || 'object' === typeof self && self || {}));

plugins/css-has-pseudo/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to CSS Has Pseudo
22

3+
### Unreleased
4+
5+
- Fix: assign global browser polyfill to `window`, `self` or a blank object.
6+
37
### 4.0.0 (July 8, 2022)
48

59
[Read the full changelog](https://github.com/csstools/postcss-plugins/wiki/PostCSS-Preset-Env-8)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
/* global self */
1+
/* global self,window */
22
import { default as cssHasPseudo } from './browser';
3-
self.cssHasPseudo = cssHasPseudo;
3+
4+
(function (global) {
5+
global.cssHasPseudo = cssHasPseudo;
6+
}('object' === typeof window && window || 'object' === typeof self && self || {}));

plugins/css-prefers-color-scheme/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to Prefers Color Scheme
22

3+
### Unreleased
4+
5+
- Fix: assign global browser polyfill to `window`, `self` or a blank object.
6+
37
### 7.0.0 (July 8, 2022)
48

59
[Read the full changelog](https://github.com/csstools/postcss-plugins/wiki/PostCSS-Preset-Env-8)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
/* global self */
1+
/* global self,window */
22
import { default as prefersColorSchemeInit } from './browser';
3-
self.prefersColorSchemeInit = prefersColorSchemeInit;
3+
4+
(function (global) {
5+
global.prefersColorSchemeInit = prefersColorSchemeInit;
6+
}('object' === typeof window && window || 'object' === typeof self && self || {}));

plugins/postcss-focus-within/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to PostCSS Focus Within
22

3+
### Unreleased
4+
5+
- Fix: assign global browser polyfill to `window`, `self` or a blank object.
6+
37
### 6.1.0 (July 30, 2022)
48

59
- Added: `disablePolyfillReadyClass` plugin option to prevent `.js-focus-within` from being added.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
/* global self */
1+
/* global self,window */
22
import { default as focusWithinInit } from './browser';
3-
self.focusWithinInit = focusWithinInit;
3+
4+
(function (global) {
5+
global.focusWithinInit = focusWithinInit;
6+
}('object' === typeof window && window || 'object' === typeof self && self || {}));

0 commit comments

Comments
 (0)