@atyoursite/polyfill
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Polyfills

aysPolyfillObjectFit()

Description

aysPolyfillObjectFit() checks if the browser supports object-fit.
if not, all img elements with parameter [data-object-fit="cover"] and [data-object-fit="contain"] will be converted to background versions.
Background image cover and contain are fully supported.

<img src="{{path to image file}}" data-object-fit="contain" alt="{{alternative description}}">

Dependency

Open a terminal window inside the root of your project to install the node package.

npm install --save-dev @atyoursite/polyfill

Usage

To be able to use the function, you will have to import it as a dependency

import { aysPolyfillObjectFit } from '@atyoursite/polyfill';

Initialize

aysPolyfillObjectFit();

Readme

Keywords

none

Package Sidebar

Install

npm i @atyoursite/polyfill

Weekly Downloads

2

Version

1.0.5

License

ISC

Unpacked Size

2.66 kB

Total Files

4

Last publish

Collaborators

  • benluts
  • guypensart
  • jocorthals