postcss-px-to-viewport icon indicating copy to clipboard operation
postcss-px-to-viewport copied to clipboard

A plugin for PostCSS that generates viewport units (vw, vh, vmin, vmax) from pixel units. The best choice to create a scalable interface on different displays by one design size.

Results 108 postcss-px-to-viewport issues
Sort by recently updated
recently updated
newest added

Pc端的设计稿是1920 mobile的设计稿是750 问题:这里想要做一个判断viewportWidth在pc的时候值为1920,mobile的时候值是750; 目前的做法是: 1. const screenWidth = /Android|webOS|iPhone|iPad|BlackBerry|iPad/i.test(navigator.userAgent) ? 750 : 1920 // node环境下无法判断终端是pc还是mobile 2. plugins: [ require("postcss-px-to-viewport")({ ... viewportWidth : screenWidth ... ]

postcss-px-to-viewport: postcss.plugin was deprecated. Migration guide:

我用的vue+sass,/* px-to-viewport-ignore-next */以及/* px-to-viewport-ignore */均不能在sass里使用,纯css可以。希望能支持预处理器

有些ui库的设计尺寸可能不一样,这样可以通过文件名对不同的ui库做自定义设置。

Add Chinese translation for Ignoring.

set proList such this: const pxtovwConfig={ unitToConvert: 'px', fontViewportUnit: 'vw', viewportWidth: 750, unitPrecision: 5, proList: ['*', '!font-size'], minPixelValue:1, } but css' font-size is also set to vw;

怎么动态设置viewportWidth的值?我想实现微信调整字体大小的那种效果,通过改变rpx的换算比率,实现字体大小和布局的动态缩小放大