New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fylgja/aspect-ratio

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fylgja/aspect-ratio

The aspect ratio component allows you to make not just videos. But anything you want to a certain responsive aspect ratio

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
decreased by-38.1%
Maintainers
1
Weekly downloads
 
Created
Source

Fylgja - Aspect Ratio

NPM version license

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.

Installation

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 support

If 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";

How to use

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>

Config

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;

Keywords

FAQs

Package last updated on 15 Dec 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc