# postcss-px-to-px-dt

> A CSS post-processor that converts px to px

Latest version **0.0.3** (published 2023-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-px-to-px-dt
pnpm add postcss-px-to-px-dt
yarn add postcss-px-to-px-dt
bun add postcss-px-to-px-dt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-02-24 |
| First published | 2023-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | FengXianGuo 824042624@qq.com |
| Maintainers | guofengxian |
| Keywords | postcss, css, postcss-plugin, postcss-px-to-px-dt |

## Links

- npm: https://www.npmjs.com/package/postcss-px-to-px-dt
- Repository: https://github.com/FengXianGuo/postcss-px-to-px-dt
- Homepage: https://github.com/FengXianGuo/postcss-px-to-px-dt#readme
- Issues: https://github.com/FengXianGuo/postcss-px-to-px-dt/issues
- npm.io page: https://npm.io/package/postcss-px-to-px-dt

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2023-02-24
- 0.0.1 — 2023-02-24

## README

# postcss-px-to-px-dt

[PostCSS] plugin to convert `px` values to `px` values, like 750px(local) to 375px(device).

```css
.foo {
  width:40px;
}
```

```css
.foo {
  width:20px;
}
```

## Usage

**Step 1:** Install plugin:

```sh
npm install --save-dev postcss postcss-px-to-px-dt
```

**Step 2:** Check your project for existing PostCSS config: `postcss.config.js`
in the project root, `"postcss"` section in `package.json`
or `postcss` in bundle config.

If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.

**Step 3:** Add the plugin to plugins list:

```diff
module.exports = {
  plugins: [
+   require('postcss-px-to-px-dt'),
    require('autoprefixer')
  ]
}
```
## Options

You can set `viewportWidth` is real viewport. The default `viewportWidth` is 375.

Yon can set `devViewportWidth` is dev environment viewport. The default `devViewportWidth` is 750.

```diff
module.exports = {
  plugins: [
+   require('postcss-px-to-px-dt',{viewportWidth:375,devViewportWidth:750}),
    require('autoprefixer')
  ]
}
```

---
_Source: https://npm.io/package/postcss-px-to-px-dt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
