Aspect Ratio

Aspect Ratio Box is essential for multimedia such as videos, movies or card like contents.

Refer to css-tricks.com -> almanac -> aspect-ratio

Preview


Module path


js

import { aspectRatio } from 'gadjet/dist/module/style/aspect-ratio.js';

Function signature


aspectRatio(ratio?: string = '1/1') => string;

param ratio: string = '1/1'

width/height ratio

return

CSS string

Usage


import { addStyle, aspectRatio } from 'gadjet';

addStyle`
div {
    ${aspectRatio('1/1')}
}
`
gadjet
Getting Started Style Portion UI