DPI aware image CustomElement
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
src
static
.babelrc
.gitignore
README.md
package-lock.json
package.json

README.md

dpi-aware-image

An img element which determine own physical width and height by considering source png image's DPI.

$ npm install
$ npm run demo

Open http://localhost:9001/demo/index.html

Usage

<style>
  /* Optional */
  dpi-aware-image {
    display: inline-block;
    --max-width: 100%;
    --max-height: 300px;
  }
</style>

<dpi-aware-image src='/demo/dist/icon.png'></dpi-aware-image>

Demos