Web Components which provides fluid width <iframe>.
MIT License
Web Components which provides fluid width
<iframe>
.
Using npm:
$ npm install fluid-iframe
Import FluidIframe
and register it as a custom element.
<script type="module">
import FluidIframe from 'https://unpkg.com/fluid-iframe';
customElements.define('fluid-iframe', FluidIframe);
</script>
Put <fluid-iframe>
.
<fluid-iframe
src="https://www.youtube.com/embed/EqNHSrHzSOU"
title="Santa Tracker: Out Like A Light"
aspect="16/9">
</fluid-iframe>
src
attributeURL string which will be set as <iframe src>
.
title
attributeTitle string which will be set as <iframe title>
.
aspect
attributex/y
format string will be calculated for aspect ratio. Default value is 16/9
.