@odopod/odo-object-fit

1.1.1 • Public • Published

Odo Object Fit

Fits media elements (img, video). It polyfills CSS' object-fit: cover; If the browser supports object-fit, it will not run. The media element should have full width and height as well as the object-fit property.

Install

npm install @odopod/odo-object-fit --save

Quick Start

.my-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
import OdoObjectFit from '@odopod/odo-object-fit';

// Cover a single element.
OdoObjectFit.cover(myElement);

// Cover multiple media elements.
OdoObjectFit.cover([myElement, thatOtherElement]);

Documentation

Visit the Odo component directory for demos, code examples, and documentation.

Package Sidebar

Install

npm i @odopod/odo-object-fit

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

55.9 kB

Total Files

17

Last publish

Collaborators

  • nathanbuchar
  • odopod-admin
  • vestride