# css-x2x-loader

> webpack loader for x2x css file

Latest version **0.1.2** (published 2020-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-x2x-loader
pnpm add css-x2x-loader
yarn add css-x2x-loader
bun add css-x2x-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2020-05-28 |
| First published | 2020-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | sansui |
| Maintainers | sanmuu |
| Keywords | webpack, loader, css, px2rem, rem2rpx, px2rpx |

## Links

- npm: https://www.npmjs.com/package/css-x2x-loader
- Repository: https://github.com/ssmNydia/css-x2x-loader
- Homepage: https://github.com/ssmNydia/css-x2x-loader#readme
- Issues: https://github.com/ssmNydia/css-x2x-loader/issues
- npm.io page: https://npm.io/package/css-x2x-loader

## Dependencies (3)

- [css](https://npm.io/package/css.md) ^2.2.4
- [extend](https://npm.io/package/extend.md) ^3.0.2
- [loader-utils](https://npm.io/package/loader-utils.md) ^2.0.0

## 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.1.2 (latest) — 2020-05-28
- 0.1.1 — 2020-05-27
- 0.1.0 — 2020-05-27

## README

# css-x2x-loader
Webpack loader for x2x css file



## Getting Started

To begin, you'll need to install `css-x2x-loader`

```shell
$ npm install --save-dev css-x2x-loader
```



Then add the plugin to your `webpack` config.For example:

#### webpack.config.js

```javascript
module.exports = {
	// ...
  module: {
    rules: [{
      test: /\.css$/,
      use: [{
        loader: 'style-loader'
      },
      {
        loader: 'css-loader'
      },
      {
        loader: 'css-x2x-loader',
        options: {
          type: 'px2rem',
          tagUnit: 75,
          tagPrecision: 8
        }
      }]
    }]
  }
}

```



## options

| name         | Type     | Default |
| ------------ | -------- | ------- |
| type         | {String} | px2rem  |
| tagUnit      | {Number} | 100     |
| tagPrecision | {Number} | 6       |

#### type

Default: `"px2rem"`

Supported values:

* `px2rpx`
* `rem2px`
* `rem2rpx`
* `rpx2px`
* `rpx2rem`

#### tagUnit

Default: `100`

The `100` value means `100px = 1rem`.

#### tagPrecision

Default: `6`

The `6`value means keep six decimal place.

---
_Source: https://npm.io/package/css-x2x-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
