postcss-focus
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -0,1 +1,5 @@ | ||
## 1.0 | ||
* Use PostCSS 5.0 API. | ||
* Do not add spaces for compressed styles. | ||
## 0.1.1 | ||
@@ -2,0 +6,0 @@ * Support PostCSS Plugin Guidelines. |
@@ -5,3 +5,3 @@ var postcss = require('postcss'); | ||
return function (css) { | ||
css.eachRule(function (rule) { | ||
css.walkRules(function (rule) { | ||
if ( rule.selector.indexOf(':hover') !== -1 ) { | ||
@@ -15,3 +15,3 @@ var focuses = []; | ||
if ( focuses.length ) { | ||
rule.selector = rule.selector + ', ' + focuses.join(', '); | ||
rule.selectors = rule.selectors.concat(focuses); | ||
} | ||
@@ -18,0 +18,0 @@ } |
{ | ||
"name": "postcss-focus", | ||
"version": "0.1.1", | ||
"description": "PostCSS plugin to add :focus selector to every :hover", | ||
"keywords": ["postcss", "css", "postcss-plugin", "hover", "focus", "a11y"], | ||
"author": "Andrey Sitnik <andrey@sitnik.ru>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/postcss/postcss-focus.git" | ||
}, | ||
"dependencies": { | ||
"postcss": "^4.1.8" | ||
}, | ||
"devDependencies": { | ||
"gulp-eslint": "0.11.1", | ||
"gulp-mocha": "2.0.1", | ||
"mocha": "2.2.4", | ||
"chai": "2.3.0", | ||
"gulp": "3.8.11" | ||
}, | ||
"scripts": { | ||
"test": "gulp" | ||
} | ||
"name": "postcss-focus", | ||
"version": "1.0.0", | ||
"description": "PostCSS plugin to add :focus selector to every :hover", | ||
"keywords": [ | ||
"postcss", | ||
"css", | ||
"postcss-plugin", | ||
"hover", | ||
"focus", | ||
"a11y" | ||
], | ||
"author": "Andrey Sitnik <andrey@sitnik.ru>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/postcss/postcss-focus.git" | ||
}, | ||
"dependencies": { | ||
"postcss": "^5.0.2" | ||
}, | ||
"devDependencies": { | ||
"gulp-eslint": "1.0.0", | ||
"gulp-mocha": "2.1.3", | ||
"mocha": "2.2.5", | ||
"chai": "3.2.0", | ||
"gulp": "3.9.0" | ||
}, | ||
"scripts": { | ||
"test": "gulp" | ||
} | ||
} |
@@ -9,7 +9,13 @@ # PostCSS Focus [![Build Status][ci-img]][ci] | ||
[PostCSS]: https://github.com/postcss/postcss | ||
[ci-img]: https://travis-ci.org/postcss/postcss-focus.svg | ||
[ci]: https://travis-ci.org/postcss/postcss-focus | ||
See also [postcss-pseudo-class-enter] for more explicit way. | ||
[postcss-pseudo-class-enter]: https://github.com/jonathantneal/postcss-pseudo-class-enter | ||
[PostCSS]: https://github.com/postcss/postcss | ||
[ci-img]: https://travis-ci.org/postcss/postcss-focus.svg | ||
[ci]: https://travis-ci.org/postcss/postcss-focus | ||
```css | ||
*:focus { | ||
outline: 0; | ||
} | ||
.button:hover { | ||
@@ -21,2 +27,5 @@ background: red; | ||
```css | ||
*:focus { | ||
outline: 0; | ||
} | ||
.button:hover, .button:focus { | ||
@@ -23,0 +32,0 @@ background: red; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8484
1
41
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-flag@1.0.0(transitive)
+ Addedjs-base64@2.6.4(transitive)
+ Addedpostcss@5.2.18(transitive)
+ Addedsource-map@0.5.7(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.03.2.3(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedes6-promise@2.3.0(transitive)
- Removedjs-base64@2.1.9(transitive)
- Removedpostcss@4.1.16(transitive)
- Removedsource-map@0.4.4(transitive)
Updatedpostcss@^5.0.2