Socket
Socket
Sign inDemoInstall

@moohng/postcss-px2vw

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

@moohng/postcss-px2vw - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

7

index.js

@@ -27,5 +27,6 @@ 'use strict';

if (opts.viewportWidth) {
decl.parent.insertBefore(i, decl.clone({
value: value.replace(pxRegex, pxReplaceForRem)
}));
var newValue = value.replace(pxRegex, pxReplaceForRem);
if (newValue !== value) {
decl.parent.insertBefore(i, decl.clone({ value: newValue }));
}
} else {

@@ -32,0 +33,0 @@ decl.value = value.replace(pxRegex, pxReplaceForRem);

{
"name": "@moohng/postcss-px2vw",
"version": "1.0.1",
"version": "1.0.2",
"description": "A CSS post-processor that converts px to vw and fallback rem.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,3 +5,3 @@ # postcss-px2vw

该插件主要结合了 [postcss-pxtorem](https://github.com/cuth/postcss-pxtorem) 和 [postcss-px-to-viewport](https://github.com/evrone/postcss-px-to-viewport) 的功能,精简了不常用的配置。默认将 `vw` 作为优选单位使用,以 `rem` 作为回退模式。考虑到 `vw` 在一些老旧设备上支持不够理想,这款插件很好的解决了该问题。
该插件主要结合了 [postcss-pxtorem](https://github.com/cuth/postcss-pxtorem) 和 [postcss-px-to-viewport](https://github.com/evrone/postcss-px-to-viewport) 的功能,精简了不常用的配置。默认将 `vw` 作为优先单位使用,以 `rem` 作为回退模式。考虑到 `vw` 在移动设备的支持度不如 `rem`,这款插件很好的解决了该问题。

@@ -20,3 +20,3 @@ ## 安装

plugins: {
'postcss-px2vw': {}
'@moohng/postcss-px2vw': {}
}

@@ -58,3 +58,3 @@ }

## 致谢
## 最后

@@ -61,0 +61,0 @@ 如果你觉得对你有帮助,欢迎 star 和 issue

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