Socket
Book a DemoInstallSign in
Socket

@astii/autofit

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astii/autofit

autofit

0.0.4
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@astii/autofit

NPM version NPM downloads

Usage

$ yarn add @astii/autofit

autoScale

//entry of app
import { autoFit, autoScale } from "@astii/autofit";

autoScale({ dw: 375 });

autoFit

//entry of app
import { autoFit, autoScale } from "@astii/autofit";

autoFit({ dw: 375, dh: 667 });

with "viewport"

"px" need convert to "vw" and "vh"

.card {
  /* width: 300px;
  height: 300px; */
  width: calc(300 * var(--pxw));
  height: calc(300 * var(--pxh));
}

with "rem"

"px" need convert to "rem"

.card {
  /* width: 300px;
  height: 300px; */
  width: calc(300 / var(--rem));
  height: calc(300 / var(--rem));
}

Options

NameTypeDefaultDescription
dwnumber-design width
dhnumberwindow.innerHeight(viewport mode default to 100)design height
fitType"viewport" | "rem""viewport"autoFit type

LICENSE

MIT

Keywords

autoFit

FAQs

Package last updated on 17 May 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.