![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@fylgja/aspect-ratio
Advanced tools
The aspect ratio component allows you to make not just videos. But anything you want to a certain responsive aspect ratio
The aspect ratio component is used to set videos to a certain responsive aspect ratio,
but can also be used for images and other content.
npm install @fylgja/aspect-ratio
Then include the component in to your code via;
@use "@fylgja/aspect-ratio";
// Or via PostCSS import
@import "@fylgja/aspect-ratio";
@layer
supportIf you need support for @layer
,
use the following import;
@use "@fylgja/aspect-ratio" with ($enable-aspect-ratio-layer: true);
// Or via PostCSS import
@import "@fylgja/aspect-ratio/layer";
To use the aspect-ratio, create element with the class .aspect-ratio
,
any child of the aspect-ratio will now always be show in the ratio set by the class.
16/9 is the default ratio.
To edit the ratio use the css variable with the same name.
<div class="aspect-ratio" style="--aspect-ratio: 21/9;">..</div>
As with almost all of our components, CSS variables can be configured to add your own look/style.
Want direct control on the base styles, here are the following SCSS variables can you modify.
$enable-aspect-ratio-layer: false !default;
$aspect-ratio-layer-name: components !default;
$aspect-ratio: "16/9" !default;
[1.2.0] - 2022-07-24
FAQs
The aspect ratio component allows you to make not just videos. But anything you want to a certain responsive aspect ratio
The npm package @fylgja/aspect-ratio receives a total of 39 weekly downloads. As such, @fylgja/aspect-ratio popularity was classified as not popular.
We found that @fylgja/aspect-ratio demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.