2createStudio / postcss-sprites

Generate sprites from stylesheets.
MIT License
413 stars 50 forks source link

Support for retina? #91

Closed oimos closed 7 years ago

oimos commented 7 years ago

I'm trying to figure out how it works for retina display in postcss-cli. I added "retina:true" but it does not work. I know somebody asked the same question before and closed but no luck for me. Could you take a look? Thanks!

module.exports = {
    plugins: [
        require('postcss-will-change'),
        require('postcss-sprites')({
            stylesheetPath: './',
            spritePath: './img/',
            retina: true,
            spritesmith: {
                padding: 10,
                algorithm: 'top-down'
            }
        }),
        require('autoprefixer')({
            browsers: ['> 0.01%']
        }),
        require('postcss-simple-vars'),
        require('postcss-nested'),
        require('postcss-flexbugs-fixes'),
        require('cssnext'),
        require('postcss-import')
    ]
}
oimos commented 7 years ago

I missed this line in the document.

Built-in filters: based on @2x naming convention

I needed to add @2x to the file name in background-image. Thanks!