jacobrask / styledocco

Automatically generate a style guide from your stylesheets.
http://jacobrask.github.com/styledocco/
MIT License
1.07k stars 119 forks source link

Include images (sprites) in Styledocco's output #131

Open paulwellnerbou opened 9 years ago

paulwellnerbou commented 9 years ago

I am working in a big, grown project with hells of CSS, trying to introduce SCSS/SASS and Styledocco there step for step.

For the examples of the output styledocco gives me (we are using maven and grunt), I include generated sprite css files (which works fine with the include option). Is there any way to include the images the CSS is relying on as well?

paulwellnerbou commented 9 years ago

I found a way to make this work... at least in chrome.

  1. I use a copy task to copy the image directories into the directory where the styledocco output is saved
  2. I start a local browser (using grunt server, but any will do), so that the absolute paths of the css backgrounds are correct.

Unfortunately this is working in Chrome, but does not work in Firefox. It seems to have something to do with the preview iframe URL. In Firefox there is "data:text/html;...." (which generates a URL like chrome://browser/... for images referenced in CSS), in Chrome the iframe URL is the local URL with an anchor.

paulwellnerbou commented 9 years ago

I created a test project showing this problem: https://github.com/paulwellnerbou/styledocco-test-project