# override-clsx

> Small layer on top of [clsx](https://www.npmjs.com/package/clsx) to allow for generic overrides. This improves intellisense for custom re-used class names.

Latest version **1.0.1** (published 2020-06-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install override-clsx
pnpm add override-clsx
yarn add override-clsx
bun add override-clsx
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-06-17 |
| First published | 2020-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jeroen Peeters |
| Maintainers | _jptrs |

## Links

- npm: https://www.npmjs.com/package/override-clsx
- Repository: https://github.com/jeroenptrs/override-clsx
- Homepage: https://github.com/jeroenptrs/override-clsx#readme
- Issues: https://github.com/jeroenptrs/override-clsx/issues
- npm.io page: https://npm.io/package/override-clsx

## Dependencies (1)

- [clsx](https://npm.io/package/clsx.md) ^1.1.1

## Recent versions

- 1.0.1 (latest) — 2020-06-17
- 1.0.0 — 2020-06-17

## README

# override-clsx

Small layer on top of [clsx](https://www.npmjs.com/package/clsx) to allow for generic overrides. This improves intellisense for custom re-used class names.

```bash
npm i override-clsx
yarn add override-clsx
```

```ts
import clsx, { createOverride } from "override-clsx";

type MyClasses = "a" | "b" | "c";

// ad-hoc override
clsx<MyClasses>("a", "b");
clsx<MyClasses>(true && "a");
clsx<MyClasses>(0 && "a");
clsx<MyClasses>({ a: true });

// exportable override
const classNames = createOverride<MyClasses>();
classNames<MyClasses>("a", "b");
classNames<MyClasses>(true && "a");
classNames<MyClasses>(0 && "a");
classNames<MyClasses>({ a: true });
```

This project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx).

## Contribute

Below is a list of commands you will probably find useful.

### `npm start` or `yarn start`

Runs the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab. Your library will be rebuilt if you make edits.

### `npm run build` or `yarn build`

Bundles the package to the `dist` folder. The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).

### `npm test` or `yarn test`

Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.

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