Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
stylis-plugin-px2vw
Advanced tools
一个 stylis 插件,用于将 px 换算为 vw 单位,可用于 css-in-js 库 @emotion/css
其他使用了 stylis 的库,如支持插件也可以使用
demo 见 src/example.ts
import createEmotion from '@emotion/css/create-instance'
import stylisPluginPx2vw from 'stylis-plugin-px2vw'
const customEmotion = createEmotion({
key: 'm',
stylisPlugins: [stylisPluginPx2vw({
excludes: ['font-size'] // 不需要转换的属性
minWidth: 320, // 最小宽度 默认
width: 375, // 设计稿宽度 默认
precision: 4, // 转换 vw 单位精度 默认
})],
})
只匹配小写的 px, 如果有特别的属性值不希望转换,可以写成大写 PX,如:width: 100PX;
FAQs
一个将 px 换算成 vw 的 stylis 插件
The npm package stylis-plugin-px2vw receives a total of 2 weekly downloads. As such, stylis-plugin-px2vw popularity was classified as not popular.
We found that stylis-plugin-px2vw demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.