Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-viewport-units-transform

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-viewport-units-transform

Transform CSS viewport units of a style object to pixels based on window dimensions

  • 0.10.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

css-viewport-units-transform

Build Status Build status Coverage Status Size PRs Welcome

Transform CSS viewport units of a Javascript style object to pixels based on window dimensions.

Supports vw, vh, vmin and vmax units.

import { transform } from "css-viewport-units-transform";
// or const transform = require("css-viewport-units-transform").transform;

transform(
  {
    fontSize: "10vw"
  },
  {
    width: 480,
    height: 100
  }
);

↓ ↓ ↓ ↓ ↓ ↓

{
  fontSize: 48;
}

or

transform(
  {
    myClass: {
      fontSize: "10vh"
    }
  },
  {
    width: 480,
    height: 100
  }
);

↓ ↓ ↓ ↓ ↓ ↓

{
  myClass: {
    fontSize: 10,
  }
}

Dependencies

  • None

Keywords

FAQs

Package last updated on 05 Mar 2019

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