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

postcss-pxconverter

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-pxconverter

px to rem or vw

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

postcss-pxconverter

目前存在的问题

  1. rem 布局受到 root font-size 影响,如果 Android 开启了字号放大模式,会导致整个布局崩盘。
  2. Android 下 viewport scale 强制为 1,一些 Canvas 绘制的内容略为模糊。部分 Android 设备改变 scale 有 bug,机型太多较难定位。

改进的思路

  1. 保留原本 rem 方案的基础上,对于非 font-size 的单位渐进增强,在 rem 的规则下面新增一条 vw 的规则进行覆盖。此方案可以保证低版本 Android 的兼容问题,也可以避免修改 DPR 导致的不可控后果。
  2. (尝试)建立一个 Android UA 白名单,在白名单内的设备允许开启高 DPR 模式。

可能的缺陷

  1. CSS 体积增加。

FAQs

Package last updated on 19 Dec 2018

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