Skip to content

Choose a plugin

Start with the unit that appears in your source CSS and the unit your runtime expects. The focused plugins keep familiar APIs; postcss-rule-unit-converter is the composition layer when one stylesheet needs several conversion rules.

Conversion map

SourceTargetPackageBest for
rempx / rpxpostcss-rem-to-responsive-pixelExisting rem-to-pixel pipelines and Tailwind output
remvw / vhpostcss-rem-to-viewportViewport-based responsive layouts
pxrpx / rem / vwpostcss-pxtransWeapp, H5, React Native, Quick App and Harmony presets
Any supported unitpxpostcss-units-to-pxA small legacy API with a configurable unitMap
Any supported unitAny targetpostcss-rule-unit-converterComposable rules, grouped presets and custom transforms
Utility building blockspostcss-plugin-sharedWriting a plugin that shares matching and rounding behavior

Pick the smallest stable API

Use a focused package when its source and target match your project. Use the rule engine when you need to process px, rem, rpx, vw or vh in one PostCSS pass, or when the conversion policy belongs in a reusable preset.

Next step

Read PostCSS integration, then open the plugin page for its complete options and examples.

Built for CSS that moves between screens.