You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

postcss-viewport-unit-fallback

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-viewport-unit-fallback

PostCSS plugin to fallback viewport unit(dvh/lvh/svh) for old browsers.

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
3K
11.82%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-viewport-unit-fallback

PostCSS plugin to fallback viewport unit(dvh/lvh/svh) for old browsers.

.foo {
  height: 100dvh;
}
.foo {
  height: 100vh; /* Automatically add this line, and old browser doesn't support dvh use this */
  height: 100dvh; /* New browser supports dvh use this */
}

Usage

Step 1: Install plugin:

npm install --save-dev postcss postcss-viewport-unit-fallback

Step 2: Check you project for existed PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you do not use PostCSS, add it according to official docs and set this plugin in settings.

Step 3: Add the plugin to plugins list:

module.exports = {
  plugins: [
+   require('postcss-viewport-unit-fallback'),
    require('autoprefixer')
  ]
}

Keywords

postcss

FAQs

Package last updated on 24 May 2023

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