brenden / node-webshot

Easy website screenshots in Node.js
2.12k stars 285 forks source link

customCSS option not working #119

Closed Biggsen closed 9 years ago

Biggsen commented 9 years ago

Doesn't look like the option of customCSS is working. I've looked through all the code and found no mention of it. Is it enabled?

jasetom commented 9 years ago

It is working, but the problem I've encountered was me writing css in wrong format. If you want to apply customCSS to your page before webshoting it it was to be written in one line and passed as a parameter in webshot function. Example:

var options = { siteType: 'html', shotSize: {width: 1400, height: 600}, defaultWhiteBackground: true, customCSS: 'body{font:10px sans-serif;} .axis path,.axis line{fill: none; stroke:#000;}' };

//Using webshot webshot(svgsrc,'Graphi3.png',options,function(err) { //saves image });

brenden commented 9 years ago

Hey thanks @jasetom for answering that. Just for my understanding, what's the format that wasn't working for you? Newlines in the customCSS string?

jasetom commented 9 years ago

@brenden yes I believe that was the problem

brenden commented 9 years ago

Hmmm just tried with newlines and it worked fine for me. I'll close this ticket for now, though feel free to reopen if you have a sample showing the error.