css-blank-pseudo
Advanced tools
Comparing version 0.1.2 to 0.1.3
# Changes to CSS Blank Pseudo | ||
### 0.1.3 (November 17, 2018) | ||
- Improve CLI usage | ||
### 0.1.2 (November 17, 2018) | ||
@@ -4,0 +8,0 @@ |
@@ -31,3 +31,3 @@ #!/usr/bin/env node | ||
if (process.argv.length < 3) { | ||
console.log(['CSS Blank Pseudo\n', ' Transforms CSS with :blank {}\n', 'Usage:\n', ' css-blank-pseudo source.css transformed.css', ' css-blank-pseudo --in=source.css --out=transformed.css --opts={}', ' echo "@media (prefers-color-scheme: dark) {}" | css-\n'].join('\n')); | ||
console.log(['CSS Blank Pseudo\n', ' Transforms CSS with :blank {}\n', 'Usage:\n', ' css-blank-pseudo source.css transformed.css', ' css-blank-pseudo --in=source.css --out=transformed.css --opts={}', ' echo "@media (prefers-color-scheme: dark) {}" | css-blank-pseudo\n'].join('\n')); | ||
process.exit(0); | ||
@@ -40,3 +40,3 @@ } // get process and plugin options from the command line | ||
const relaxedJsonPropRegExp = /(['"])?([a-z0-9A-Z_]+)(['"])?:/g; | ||
const relaxedJsonValueRegExp = /("[a-z0-9A-Z_]+":\s*)'([^']*)'/g; | ||
const relaxedJsonValueRegExp = /("[a-z0-9A-Z_]+":\s*)'?([A-z0-9]+)'?([,}])/g; | ||
const argo = process.argv.slice(2).reduce((object, arg) => { | ||
@@ -64,3 +64,3 @@ const argMatch = arg.match(argRegExp); | ||
(argo.from === '<stdin>' ? getStdin() : readFile(argo.from)).then(css => { | ||
const pluginOpts = JSON.parse(argo.opts.replace(relaxedJsonPropRegExp, '"$2": ').replace(relaxedJsonValueRegExp, '$1"$2"')); | ||
const pluginOpts = JSON.parse(argo.opts.replace(relaxedJsonPropRegExp, '"$2": ').replace(relaxedJsonValueRegExp, '$1"$2"$3')); | ||
const processOptions = Object.assign({ | ||
@@ -67,0 +67,0 @@ from: argo.from, |
{ | ||
"name": "css-blank-pseudo", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Style form elements when they are empty", | ||
@@ -38,3 +38,3 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>", | ||
"build:node": "rollup -c .rollup.js --silent && cross-env NODE_ENV=legacy rollup -c .rollup.js --silent", | ||
"prepublishOnly": "npm build && npm test", | ||
"prepublishOnly": "npm run build && npm test", | ||
"pretest": "npm run build:postcss", | ||
@@ -41,0 +41,0 @@ "pretest:postcss": "npm run build:postcss", |
@@ -74,10 +74,4 @@ # CSS Blank Pseudo [<img src="http://jonathantneal.github.io/js-logo.svg" alt="" width="90" height="90" align="right">][CSS Blank Pseudo] | ||
```html | ||
<div class="field"> | ||
<label for="a">Field</label> | ||
<input id="a" value="" blank> | ||
</div> | ||
<div class="field"> | ||
<label for="b">Field</label> | ||
<input id="b" value="This element has a value"> | ||
</div> | ||
<input value="" blank> | ||
<input value="This element has a value"> | ||
``` | ||
@@ -84,0 +78,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
519
63942
88