grunt-dehoverify
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "grunt-dehoverify", | ||
"description": "Remove :hover styles from your CSS", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "https://github.com/Lapple/grunt-dehoverify", | ||
@@ -31,3 +31,4 @@ "author": { | ||
"dependencies": { | ||
"rework": "~0.20.2" | ||
"rework": "~0.20.2", | ||
"rework-walk": "~1.0.0" | ||
}, | ||
@@ -34,0 +35,0 @@ "devDependencies": { |
@@ -28,5 +28,2 @@ # grunt-dehoverify | ||
dehoverify: { | ||
options: { | ||
// Task-specific options go here. | ||
}, | ||
your_target: { | ||
@@ -39,49 +36,2 @@ // Target-specific file lists and/or options go here. | ||
### Options | ||
#### options.separator | ||
Type: `String` | ||
Default value: `', '` | ||
A string value that is used to do something with whatever. | ||
#### options.punctuation | ||
Type: `String` | ||
Default value: `'.'` | ||
A string value that is used to do something else with whatever else. | ||
### Usage Examples | ||
#### Default Options | ||
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.` | ||
```js | ||
grunt.initConfig({ | ||
dehoverify: { | ||
options: {}, | ||
files: { | ||
'dest/default_options': ['src/testing', 'src/123'], | ||
}, | ||
}, | ||
}) | ||
``` | ||
#### Custom Options | ||
In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!` | ||
```js | ||
grunt.initConfig({ | ||
dehoverify: { | ||
options: { | ||
separator: ': ', | ||
punctuation: ' !!!', | ||
}, | ||
files: { | ||
'dest/default_options': ['src/testing', 'src/123'], | ||
}, | ||
}, | ||
}) | ||
``` | ||
## Contributing | ||
@@ -88,0 +38,0 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). |
@@ -12,2 +12,3 @@ /* | ||
var rework = require('rework'); | ||
var walk = require('rework-walk'); | ||
@@ -47,4 +48,4 @@ module.exports = function(grunt) { | ||
function dehoverify(style) { | ||
style.rules = style.rules.map(function(rule) { | ||
if (!rule.selectors) return rule; | ||
walk(style, function(rule) { | ||
if (!rule.selectors) return; | ||
@@ -58,5 +59,3 @@ rule.selectors = rule.selectors.filter(function(selector) { | ||
} | ||
return rule; | ||
}); | ||
}) | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
148
7910
3
40
+ Addedrework-walk@~1.0.0
+ Addedrework-walk@1.0.0(transitive)