# postcss-viewport-unit-fallback

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

Latest version **1.0.1** (published 2023-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-viewport-unit-fallback
pnpm add postcss-viewport-unit-fallback
yarn add postcss-viewport-unit-fallback
bun add postcss-viewport-unit-fallback
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-05-24 |
| First published | 2023-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | gooodev |
| Maintainers | gooodev |
| Keywords | postcss, css, postcss-plugin, postcss-viewport-unit-fallback |

## Links

- npm: https://www.npmjs.com/package/postcss-viewport-unit-fallback
- Repository: https://github.com/gooodev/postcss-viewport-unit-fallback
- Homepage: https://github.com/gooodev/postcss-viewport-unit-fallback#readme
- Issues: https://github.com/gooodev/postcss-viewport-unit-fallback/issues
- npm.io page: https://npm.io/package/postcss-viewport-unit-fallback

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-05-24

## README

# postcss-viewport-unit-fallback

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

[postcss]: https://github.com/postcss/postcss

```css
.foo {
  height: 100dvh;
}
```

```css
.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:

```sh
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:

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

[official docs]: https://github.com/postcss/postcss#usage

---
_Source: https://npm.io/package/postcss-viewport-unit-fallback · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
