diff --git a/README.md b/README.md index 30cd6bd..a42b388 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ A lazy way to generate sprites and proper CSS with retina support. Feel free to ## Example +[Demo Example](https://res.devework.com/2018/postcss-lazysprite/html/index.html) + ### Input ```CSS @@ -68,7 +70,7 @@ A lazy way to generate sprites and proper CSS with retina support. Feel free to > Just a example for above output result, you can dynamic yourself with options. ``` -. +. ├── gulpfile.js ├── dist └── src @@ -78,12 +80,12 @@ A lazy way to generate sprites and proper CSS with retina support. Feel free to │   └── index.html └── slice └── filetype - ├── excel.png - ├── excel_2x.png - ├── pdf.svg - ├── ppt.png - ├── ppt@2x.png - └── word.svg + ├── excel.png + ├── excel_2x.png + ├── pdf.svg + ├── ppt.png + ├── ppt@2x.png + └── word.svg ``` More examples with different options: [nameSpace](./examples/nameSpace.md), [outputDimensions](./examples/outputDimensions.md), [dynamicClassBlock](./examples/dynamicClassBlock.md), [pseudoClass](./examples/pseudoClass.md) @@ -94,7 +96,7 @@ More examples with different options: [nameSpace](./examples/nameSpace.md), [out - Retina support (`@2x`, `@3x`, `_2x`, `_3x` are all available). -- Support SVG Sprites. +- Support SVG Sprites. [Demo](https://res.devework.com/2018/postcss-lazysprite/html/index.html) - Fully work well with Source Map. diff --git a/examples/src/html/index.html b/examples/src/html/index.html index 2426adf..2454dd3 100644 --- a/examples/src/html/index.html +++ b/examples/src/html/index.html @@ -16,25 +16,25 @@

Tip: the result is in ./examples/dist/html/index.html

-

file-type

+

file-type ( PNG + SVG Sprites )

-

center

+

center ( Pure PNG Sprites )

-

logo

+

logo ( Pure PNG Sprites )

- -

apps

+ +

apps ( Pure SVG Sprites )

diff --git a/index.js b/index.js index e61514e..7bfe2b4 100755 --- a/index.js +++ b/index.js @@ -204,7 +204,7 @@ function extractImages(css, options) { var files = fs.readdirSync(imageDir); files = _.orderBy(files); // Fix orders issue in mac and win's difference. _.forEach(files, function (filename) { - // Have to be png file + // Have to be png or svg file var reg = /\.(png|svg)\b/i; if (!reg.test(filename)) { return null;