# postcss-style-fixes

> [![NPM version](https://img.shields.io/npm/v/postcss-style-fixes?color=a1b858&label=)](https://www.npmjs.com/package/postcss-style-fixes) [![Download monthly](https://img.shields.io/npm/dm/postcss-style-fixes.svg)](https://www.npmjs.com/package/postcss-st

Latest version **0.1.1** (published 2023-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-style-fixes
pnpm add postcss-style-fixes
yarn add postcss-style-fixes
bun add postcss-style-fixes
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-12-07 |
| First published | 2023-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liusixin |
| Maintainers | liusixin |
| Keywords | postcss, postcss-plugin, antd, Ant Design, tailwind, tailwindcss |

## Links

- npm: https://www.npmjs.com/package/postcss-style-fixes
- Repository: https://github.com/LesixCoder/postcss-style-fixed
- Homepage: https://github.com/LesixCoder/postcss-style-fixed#readme
- Issues: https://github.com/LesixCoder/postcss-style-fixed/issues
- Funding: https://github.com/LesixCoder
- npm.io page: https://npm.io/package/postcss-style-fixes

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2023-12-07
- 0.1.0 — 2023-12-07

## README

# postcss-style-fixes

[![NPM version](https://img.shields.io/npm/v/postcss-style-fixes?color=a1b858&label=)](https://www.npmjs.com/package/postcss-style-fixes) [![Download monthly](https://img.shields.io/npm/dm/postcss-style-fixes.svg)](https://www.npmjs.com/package/postcss-style-fixes)

PostCSS plugin tries to fix all issues about [antd](https://www.npmjs.com/package/antd) with any others global CSS reset

## Features

- support antd + [TailwindCSS preflight.css](https://github.com/tailwindlabs/tailwindcss/blob/master/src/css/preflight.css)
  - fix button style conflict, ref: [ant-design/ant-design#38794](https://github.com/ant-design/ant-design/issues/38794)
  - support anchor tags with `colorPrimary` under any antd components

## Usage

```bash
npm install postcss-style-fixes --save-dev
```

```js
// postcss.config.js
module.exports = {
  plugins: {
    'tailwindcss': {},
    'autoprefixer': {},
    'postcss-style-fixes': {
      // Support multiple prefixes, if you do not custom antd class name prefix, it's not necessary option.
      prefixes: ['ant'],
    },
  },
}
```

## Transforms

### Transform `button` styles

```css
button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/* => */

button:where(:not([class*='ant'])),
[type='button']:where(:not([class*='ant'])),
[type='reset']:where(:not([class*='ant'])),
[type='submit']:where(:not([class*='ant'])) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}
```

### Add `anchor` styles

```css
:where([class*='ant']) a {
  /* colorPrimary */
  color: #1677ff;
  text-decoration: none;
}
```

## Build & Publish

- `npm run build`
- `npx changeset`
- `npx changeset version`
- `git commit`
- `npx changeset publish`
- `git push --follow-tags`

> [`changeset` prerelease doc](https://github.com/changesets/changesets/blob/main/docs/prereleases.md)

## License

[MIT](./LICENSE) License © 2023 [Yuns](https://github.com/LesixCoder)

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