Socket
Book a DemoInstallSign in
Socket

postcss-safe-area

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

postcss-safe-area

PostCSS plugin that adds browser fallbacks for safe-area env variables.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

PostCSS Safe Area

PostCSS plugin that adds browser fallbacks for safe-area env variables.

Old iOS and Android browsers don't support environment variables that are required for CSS safe areas. This plugin adds all neccessary fallbacks, and supports calc() as well as shorthand properties for multiple margin or padding values.

.foo {
  padding-top: env(safe-area-inset-top);
  margin: 5em 5em calc(5em + env(safe-area-inset-bottom)) 5em;
}
.foo {
  padding-top: 0;
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
  margin: 5em 5em calc(5em + 0px) 5em;
  margin: 5em 5em calc(5em + constant(safe-area-inset-bottom)) 5em;
  margin: 5em 5em calc(5em + env(safe-area-inset-bottom)) 5em;
}

Installation and Usage

Install this dependency using

npm install postcss-safe-area --save-dev

Now you can use the plugin using

postcss([require('postcss-safe-area')])

See PostCSS docs for examples for your environment.

Keywords

postcss

FAQs

Package last updated on 21 Apr 2021

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