Skip to content

Commit 8d74b85

Browse files
authored
Migrate css-blank-pseudo (#31)
* wip * migrate * migrate
1 parent e059ebe commit 8d74b85

22 files changed

+236
-571
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
yarn.lock
33
reports
44
.stryker-tmp
5+
package-lock.json

plugins/css-blank-pseudo/.editorconfig

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

plugins/css-blank-pseudo/.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
node_modules
2-
/browser.*
3-
/browser-legacy.*
4-
/cli.*
5-
/index.*
6-
/legacy.*
7-
/postcss.*
2+
dist
83
package-lock.json
94
yarn.lock
105
*.log*
116
*.result.css
12-
.*
7+
*.result.css.map
138
!.editorconfig
149
!.gitignore
1510
!.rollup.js

plugins/css-blank-pseudo/.rollup.js

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
'basic': {
3-
message: 'supports basic usage'
3+
message: 'supports basic usage',
44
},
55
'basic:replacewith': {
66
message: 'supports { replaceWith: ".css-blank" } usage',

plugins/css-blank-pseudo/.travis.yml

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

plugins/css-blank-pseudo/CONTRIBUTING.md

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

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ npm install css-blank-pseudo --save-dev
1616
Use [CSS Blank Pseudo] to process your CSS:
1717

1818
```js
19-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
19+
const postcssBlankPseudo = require('css-blank-pseudo');
2020

2121
postcssBlankPseudo.process(YOUR_CSS /*, processOptions, pluginOptions */);
2222
```
@@ -25,7 +25,7 @@ Or use it as a [PostCSS] plugin:
2525

2626
```js
2727
const postcss = require('postcss');
28-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
28+
const postcssBlankPseudo = require('css-blank-pseudo');
2929

3030
postcss([
3131
postcssBlankPseudo(/* pluginOptions */)
@@ -43,7 +43,7 @@ npm install postcss-cli --save-dev
4343
Use [CSS Blank Pseudo] in your `postcss.config.js` configuration file:
4444

4545
```js
46-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
46+
const postcssBlankPseudo = require('css-blank-pseudo');
4747

4848
module.exports = {
4949
plugins: [
@@ -63,7 +63,7 @@ npm install postcss-loader --save-dev
6363
Use [CSS Blank Pseudo] in your Webpack configuration:
6464

6565
```js
66-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
66+
const postcssBlankPseudo = require('css-blank-pseudo');
6767

6868
module.exports = {
6969
module: {
@@ -100,7 +100,7 @@ file:
100100

101101
```js
102102
const reactAppRewirePostcss = require('react-app-rewire-postcss');
103-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
103+
const postcssBlankPseudo = require('css-blank-pseudo');
104104

105105
module.exports = config => reactAppRewirePostcss(config, {
106106
plugins: () => [
@@ -121,7 +121,7 @@ Use [CSS Blank Pseudo] in your Gulpfile:
121121

122122
```js
123123
const postcss = require('gulp-postcss');
124-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
124+
const postcssBlankPseudo = require('css-blank-pseudo');
125125

126126
gulp.task('css', () => gulp.src('./src/*.css').pipe(
127127
postcss([
@@ -143,7 +143,7 @@ npm install grunt-postcss --save-dev
143143
Use [CSS Blank Pseudo] in your Gruntfile:
144144

145145
```js
146-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
146+
const postcssBlankPseudo = require('css-blank-pseudo');
147147

148148
grunt.loadNpmTasks('grunt-postcss');
149149

@@ -161,7 +161,7 @@ grunt.initConfig({
161161
});
162162
```
163163

164-
[CSS Blank Pseudo]: https://github.com/csstools/css-blank-pseudo
164+
[CSS Blank Pseudo]: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo
165165
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
166166
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
167167
[PostCSS]: https://github.com/postcss/postcss

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

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# CSS Blank Pseudo for Browsers [<img src="http://jonathantneal.github.io/js-logo.svg" alt="" width="90" height="90" align="right">][CSS Blank Pseudo]
22

33
[![NPM Version][npm-img]][npm-url]
4-
[![Build Status][cli-img]][cli-url]
54
[![Support Chat][git-img]][git-url]
65

76
[CSS Blank Pseudo] lets you style form elements when they are empty, following
@@ -28,15 +27,7 @@ npm install css-blank-pseudo
2827
Then include and initialize it on your document:
2928

3029
```js
31-
const cssBlankPseudo = require('css-blank-pseudo');
32-
33-
cssBlankPseudo(document);
34-
```
35-
36-
To support Internet Explorer 11, include the *browser-legacy* script:
37-
38-
```js
39-
const cssBlankPseudo = require('css-blank-pseudo/legacy');
30+
const cssBlankPseudo = require('css-blank-pseudo/browser');
4031

4132
cssBlankPseudo(document);
4233
```
@@ -67,12 +58,24 @@ cssBlankPseudo(document, {
6758
});
6859
```
6960

70-
[cli-img]: https://img.shields.io/travis/csstools/css-blank-pseudo/master.svg
71-
[cli-url]: https://travis-ci.org/csstools/css-blank-pseudo
61+
## Dependencies
62+
63+
Web API's:
64+
65+
- [MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)
66+
67+
ECMA Script:
68+
69+
- `Object.prototype.toString`
70+
- `Object.getOwnPropertyDescriptor`
71+
- `Object.defineProperty`
72+
- `Array.prototype.forEach`
73+
74+
7275
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
7376
[git-url]: https://gitter.im/postcss/postcss
7477
[npm-img]: https://img.shields.io/npm/v/css-blank-pseudo.svg
7578
[npm-url]: https://www.npmjs.com/package/css-blank-pseudo
7679

77-
[CSS Blank Pseudo]: https://github.com/csstools/css-blank-pseudo
80+
[CSS Blank Pseudo]: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo
7881
[Selectors Level 4]: https://drafts.csswg.org/selectors-4/#blank

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# CSS Blank Pseudo for PostCSS [<img src="http://jonathantneal.github.io/postcss-logo.svg" alt="" width="90" height="90" align="right">][CSS Blank Pseudo]
22

33
[![NPM Version][npm-img]][npm-url]
4-
[![Build Status][cli-img]][cli-url]
54
[![Support Chat][git-img]][git-url]
65

76
[CSS Blank Pseudo] lets you style form elements when they are empty, following
@@ -39,7 +38,7 @@ npm install css-blank-pseudo --save-dev
3938
Use [CSS Blank Pseudo] to process your CSS:
4039

4140
```js
42-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
41+
const postcssBlankPseudo = require('css-blank-pseudo');
4342

4443
postcssBlankPseudo.process(YOUR_CSS /*, processOptions, pluginOptions */);
4544
```
@@ -48,7 +47,7 @@ Or use it as a [PostCSS] plugin:
4847

4948
```js
5049
const postcss = require('postcss');
51-
const postcssBlankPseudo = require('css-blank-pseudo/postcss');
50+
const postcssBlankPseudo = require('css-blank-pseudo');
5251

5352
postcss([
5453
postcssBlankPseudo(/* pluginOptions */)
@@ -69,7 +68,7 @@ The `preserve` option defines whether the original selector should remain. By
6968
default, the original selector is preserved.
7069

7170
```js
72-
focusWithin({ preserve: false });
71+
cssBlankPseudo({ preserve: false });
7372
```
7473

7574
```css
@@ -90,7 +89,7 @@ The `replaceWith` option defines the selector to replace `:blank`. By
9089
default, the replacement selector is `[blank]`.
9190

9291
```js
93-
focusWithin({ replaceWith: '.blank' });
92+
cssBlankPseudo({ replaceWith: '.blank' });
9493
```
9594

9695
```css
@@ -109,12 +108,10 @@ input:blank {
109108
}
110109
```
111110

112-
[cli-img]: https://img.shields.io/travis/csstools/css-blank-pseudo/master.svg
113-
[cli-url]: https://travis-ci.org/csstools/css-blank-pseudo
114111
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
115112
[git-url]: https://gitter.im/postcss/postcss
116113
[npm-img]: https://img.shields.io/npm/v/css-blank-pseudo.svg
117114
[npm-url]: https://www.npmjs.com/package/css-blank-pseudo
118115

119-
[CSS Blank Pseudo]: https://github.com/csstools/css-blank-pseudo
116+
[CSS Blank Pseudo]: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo
120117
[Selectors Level 4]: https://drafts.csswg.org/selectors-4/#blank

0 commit comments

Comments
 (0)