grunt-inline-css
Advanced tools
| <html> | ||
| <head> | ||
| </head> | ||
| <body style="font-family: Arial; background: green;"> | ||
| <h1 style="border: 1px solid #ccc; color: blue;">Hi</h1> | ||
| <table> | ||
| <tr> | ||
| <td class="headline" style="font-size: 24px; padding: 5px;">Some Headline</td> | ||
| </tr> | ||
| </table> | ||
| </body> | ||
| </html> | ||
| body { | ||
| font-family: Arial; | ||
| } | ||
| h1 { | ||
| color: blue; | ||
| } | ||
| .headline { | ||
| font-size: 24px; | ||
| } | ||
| td { | ||
| padding: 5px; | ||
| } |
| <html> | ||
| <head> | ||
| <style> | ||
| h1 { | ||
| border: 1px solid #ccc; | ||
| } | ||
| </style> | ||
| <link rel="stylesheet" href="file.css"/> | ||
| </head> | ||
| <body> | ||
| <h1>Hi</h1> | ||
| <table> | ||
| <tr> | ||
| <td class="headline">Some Headline</td> | ||
| </tr> | ||
| </table> | ||
| </body> | ||
| </html> |
+1
-2
@@ -12,4 +12,3 @@ { | ||
| "eqnull": true, | ||
| "node": true, | ||
| "es5": true | ||
| "node": true | ||
| } |
+3
-2
@@ -33,7 +33,8 @@ /* | ||
| inlinecss: { | ||
| default_options: { | ||
| basic: { | ||
| options: { | ||
| extraCss: 'body { background: green; }' | ||
| }, | ||
| files: { | ||
| 'examples/out.html': 'examples/in.html', | ||
| 'tmp/out.html': 'test/fixtures/in.html' | ||
| }, | ||
@@ -40,0 +41,0 @@ }, |
+8
-0
| 0.1.4 / 2013-11-12 | ||
| ================== | ||
| * updated juice dep | ||
| * updated readme to give some love to juice | ||
| * bug - options can now be passed in. fixes #7 | ||
| * tests | ||
| 0.1.3 / 2013-06-03 | ||
@@ -3,0 +11,0 @@ ================== |
+5
-5
| { | ||
| "name": "grunt-inline-css", | ||
| "description": "Takes an html file with css link and turns inline. Great for emails.", | ||
| "version": "0.1.3", | ||
| "version": "0.1.4", | ||
| "homepage": "https://github.com/jgallen23/grunt-inline-css", | ||
@@ -30,5 +30,5 @@ "author": { | ||
| "devDependencies": { | ||
| "grunt-contrib-jshint": "~0.4.3", | ||
| "grunt-contrib-clean": "~0.4.0", | ||
| "grunt-contrib-nodeunit": "~0.1.2", | ||
| "grunt-contrib-jshint": "~0.7.1", | ||
| "grunt-contrib-clean": "~0.5.0", | ||
| "grunt-contrib-nodeunit": "~0.2.2", | ||
| "grunt": "~0.4.0" | ||
@@ -43,4 +43,4 @@ }, | ||
| "dependencies": { | ||
| "juice": "~0.3.3" | ||
| "juice": "~0.4.0" | ||
| } | ||
| } |
+3
-3
| # grunt-inline-css | ||
| > Takes an html file with css link and turns inline. Great for emails. | ||
| > Takes an html file with css link and turns inline. Great for emails. It leverages the amazing [juice](https://github.com/LearnBoost/juice) library. | ||
@@ -32,3 +32,3 @@ ## Getting Started | ||
| files: { | ||
| 'out.html': 'in.html', | ||
| 'out.html': 'in.html' | ||
| } | ||
@@ -40,5 +40,5 @@ } | ||
| You can see available options [here](https://github.com/LearnBoost/juice) | ||
| You can see available options [here](https://github.com/LearnBoost/juice#juicefilepath-options-callback) | ||
| ## Contributing | ||
| 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/). |
@@ -20,3 +20,3 @@ /* | ||
| // Merge task-specific and/or target-specific options with these defaults. | ||
| var options = this.data.options; | ||
| var options = this.options(); | ||
| var done = this.async(); | ||
@@ -30,3 +30,3 @@ var index = 0; | ||
| var filepath = f.src.toString(); | ||
| if (typeof filepath !== 'string') { | ||
| if (typeof filepath !== 'string' || filepath === '') { | ||
| grunt.log.error('src must be a single string'); | ||
@@ -33,0 +33,0 @@ return false; |
@@ -30,20 +30,12 @@ 'use strict'; | ||
| }, | ||
| default_options: function(test) { | ||
| test.expect(1); | ||
| var actual = grunt.file.read('tmp/default_options'); | ||
| var expected = grunt.file.read('test/expected/default_options'); | ||
| test.equal(actual, expected, 'should describe what the default behavior is.'); | ||
| test.done(); | ||
| }, | ||
| custom_options: function(test) { | ||
| basic: function(test) { | ||
| test.expect(1); | ||
| var actual = grunt.file.read('tmp/custom_options'); | ||
| var expected = grunt.file.read('test/expected/custom_options'); | ||
| test.equal(actual, expected, 'should describe what the custom option(s) behavior is.'); | ||
| var actual = grunt.file.read('tmp/out.html'); | ||
| var expected = grunt.file.read('test/expected/out.html'); | ||
| test.equal(actual, expected, 'should inline css'); | ||
| test.done(); | ||
| }, | ||
| } | ||
| }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9397
7.17%153
4.08%15
-6.25%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated