Skip to content

Commit d58c1a2

Browse files
CSS Blank Pseudo (#486)
* WIP * Tests and docs * Rewriting browser * Browser tests running * Touch to docs * Finishing * Minor updates * Moving the file to be `.mjs * Linted now * css-blank-pseudo : code review (#501) Co-authored-by: Romain Menke <11521496+romainmenke@users.noreply.github.com>
1 parent 68a1239 commit d58c1a2

28 files changed

+1044
-406
lines changed

plugins/css-blank-pseudo/.gitignore

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
node_modules
2-
dist
32
package-lock.json
43
yarn.lock
5-
browser.js
6-
!src/browser.js
7-
browser-legacy.js
8-
*.log*
94
*.result.css
105
*.result.css.map
11-
!.editorconfig
12-
!.gitignore
13-
!.rollup.js
14-
!.tape.js
15-
!.travis.yml
6+
dist/*

plugins/css-blank-pseudo/.tape.mjs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,35 @@ postcssTape(plugin)({
1717
preserve: false
1818
}
1919
},
20-
'generated-selector-cases': {
21-
message: 'correctly handles generated cases',
20+
'basic:wrong-replacewith': {
21+
message: 'correctly warns when replace with is invalid',
2222
warnings: 1,
23+
options: {
24+
replaceWith: '#css-blank'
25+
}
26+
},
27+
'examples/example': {
28+
message: 'minimal example',
29+
},
30+
'examples/example:preserve-false': {
31+
message: 'minimal example',
2332
options: {
2433
preserve: false
2534
}
2635
},
36+
'examples/example:replacewith': {
37+
message: 'minimal example',
38+
options: {
39+
replaceWith: '.css-blank'
40+
}
41+
},
42+
'browser': {
43+
message: 'css for browser tests',
44+
},
45+
'browser:replacewith': {
46+
message: 'css for browser tests',
47+
options: {
48+
replaceWith: '.css-blank'
49+
}
50+
},
2751
});

plugins/css-blank-pseudo/CHANGELOG.md

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

3+
### Unreleased (major)
4+
5+
- Updated: The polyfill now only attaches a single listener to the body so it's
6+
more efficient and also does less work at the MutationObserver handler.
7+
- Breaking: removed old CDN urls
8+
- Breaking: removed old CLI
9+
10+
#### How to migrate:
11+
12+
- If you use a CDN url, please update it.
13+
- Re-build your CSS with the new version of the library.
14+
15+
```diff
16+
- <script src="https://unpkg.com/css-blank-pseudo/browser"></script>
17+
- <script src="https://unpkg.com/css-blank-pseudo/browser.min"></script>
18+
+ <script src="https://unpkg.com/css-blank-pseudo/dist/browser-global.js"></script>
19+
```
20+
21+
```diff
22+
- cssBlankPseudo(document)
23+
+ cssBlankPseudoInit()
24+
```
25+
326
### 3.0.3 (February 5, 2022)
427

528
- Rebuild of browser polyfills

plugins/css-blank-pseudo/INSTALL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Installing CSS Blank Pseudo
1+
# Installing PostCSS Blank Pseudo
22

3-
[CSS Blank Pseudo] runs in all Node environments, with special instructions for:
3+
[PostCSS Blank Pseudo] runs in all Node environments, with special instructions for:
44

55
| [Node](#node) | [PostCSS CLI](#postcss-cli) | [Webpack](#webpack) | [Create React App](#create-react-app) | [Gulp](#gulp) | [Grunt](#grunt) |
66
| --- | --- | --- | --- | --- | --- |
77

88
## Node
99

10-
Add [CSS Blank Pseudo] to your project:
10+
Add [PostCSS Blank Pseudo] to your project:
1111

1212
```bash
1313
npm install postcss css-blank-pseudo --save-dev
@@ -32,7 +32,7 @@ Add [PostCSS CLI] to your project:
3232
npm install postcss-cli css-blank-pseudo --save-dev
3333
```
3434

35-
Use [CSS Blank Pseudo] in your `postcss.config.js` configuration file:
35+
Use [PostCSS Blank Pseudo] in your `postcss.config.js` configuration file:
3636

3737
```js
3838
const postcssBlankPseudo = require('css-blank-pseudo');
@@ -54,7 +54,7 @@ Add [PostCSS Loader] to your project:
5454
npm install postcss-loader css-blank-pseudo --save-dev
5555
```
5656

57-
Use [CSS Blank Pseudo] in your Webpack configuration:
57+
Use [PostCSS Blank Pseudo] in your Webpack configuration:
5858

5959
```js
6060
module.exports = {
@@ -98,7 +98,7 @@ Add [React App Rewired] and [React App Rewire PostCSS] to your project:
9898
npm install react-app-rewired react-app-rewire-postcss css-blank-pseudo --save-dev
9999
```
100100

101-
Use [React App Rewire PostCSS] and [CSS Blank Pseudo] in your
101+
Use [React App Rewire PostCSS] and [PostCSS Blank Pseudo] in your
102102
`config-overrides.js` file:
103103

104104
```js
@@ -120,7 +120,7 @@ Add [Gulp PostCSS] to your project:
120120
npm install gulp-postcss css-blank-pseudo --save-dev
121121
```
122122

123-
Use [CSS Blank Pseudo] in your Gulpfile:
123+
Use [PostCSS Blank Pseudo] in your Gulpfile:
124124

125125
```js
126126
const postcss = require('gulp-postcss');
@@ -145,7 +145,7 @@ Add [Grunt PostCSS] to your project:
145145
npm install grunt-postcss css-blank-pseudo --save-dev
146146
```
147147

148-
Use [CSS Blank Pseudo] in your Gruntfile:
148+
Use [PostCSS Blank Pseudo] in your Gruntfile:
149149

150150
```js
151151
const postcssBlankPseudo = require('css-blank-pseudo');
@@ -171,6 +171,6 @@ grunt.initConfig({
171171
[PostCSS]: https://github.com/postcss/postcss
172172
[PostCSS CLI]: https://github.com/postcss/postcss-cli
173173
[PostCSS Loader]: https://github.com/postcss/postcss-loader
174-
[CSS Blank Pseudo]: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo
174+
[PostCSS Blank Pseudo]: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo
175175
[React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss
176176
[React App Rewired]: https://github.com/timarney/react-app-rewired

plugins/css-blank-pseudo/README-BROWSER.md

Lines changed: 0 additions & 80 deletions
This file was deleted.

plugins/css-blank-pseudo/README-POSTCSS.md

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)