1.0.4 • Published 4 years ago

postcss-background-image-auto-size v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

postcss-background-image-auto-size

A PostCSS plugin to add CSS rules width and height for background-image automatically.

Get Started

Installation

$ yarn add postcss-background-image-auto-size --dev

Usage

// postcss.config.js
const autoSize = require('postcss-background-image-auto-size');

module.exports = {
    plugins: [
        autoSize(),
    ],
};

Example

/* Before */
.logo {
    background-image: url('./images/logo.png');
}

/* After */
.logo {
    background-image: url('./images/logo.png');
    width: 400px;
    height: 400px;
}

License

Licensed under the MIT License

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago