at2x() plugin for rework, formerly included in core
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

rework-plugin-at2x

Build Status

at2x() plugin for rework, formerly included in core

.at2x()

Adds at-2x keyword to background and background-image declarations to add retina support for images.

.logo {
  background-image: url('component.png') at-2x;
  width: 289px;
  height: 113px
}

yields:

.logo {
  background-image: url('component.png');
  width: 289px;
  height: 113px
}

@media all and (-webkit-min-device-pixel-ratio: 1.5) {
  .logo {
    background-image: url("component@2x.png");
    background-size: contain
  }
}