Comparing version 1.2.1 to 2.0.0-next.0
@@ -1,6 +0,10 @@ | ||
export type ClassValue = ClassArray | ClassDictionary | string | number | null | boolean | undefined; | ||
export type ClassDictionary = Record<string, any>; | ||
export type ClassArray = ClassValue[]; | ||
declare namespace clsx { | ||
type ClassValue = ClassArray | ClassDictionary | string | number | null | boolean | undefined; | ||
type ClassDictionary = Record<string, any>; | ||
type ClassArray = ClassValue[]; | ||
function clsx(...inputs: ClassValue[]): string; | ||
} | ||
export declare function clsx(...inputs: ClassValue[]): string; | ||
export default clsx; | ||
declare function clsx(...inputs: clsx.ClassValue[]): string; | ||
export = clsx; |
{ | ||
"name": "clsx", | ||
"version": "1.2.1", | ||
"version": "2.0.0-next.0", | ||
"repository": "lukeed/clsx", | ||
"description": "A tiny (228B) utility for constructing className strings conditionally.", | ||
"module": "dist/clsx.m.js", | ||
"description": "A tiny (234B) utility for constructing className strings conditionally.", | ||
"module": "dist/clsx.mjs", | ||
"unpkg": "dist/clsx.min.js", | ||
"main": "dist/clsx.js", | ||
"exports": { | ||
"import": { | ||
"types": "./clsx.d.mts", | ||
"default": "./dist/clsx.mjs" | ||
}, | ||
"default": { | ||
"types": "./clsx.d.ts", | ||
"default": "./dist/clsx.js" | ||
} | ||
}, | ||
"types": "clsx.d.ts", | ||
@@ -24,2 +34,3 @@ "license": "MIT", | ||
"files": [ | ||
"*.d.mts", | ||
"*.d.ts", | ||
@@ -26,0 +37,0 @@ "dist" |
# clsx [![CI](https://github.com/lukeed/clsx/workflows/CI/badge.svg)](https://github.com/lukeed/clsx/actions?query=workflow%3ACI) [![codecov](https://badgen.net/codecov/c/github/lukeed/clsx)](https://codecov.io/gh/lukeed/clsx) | ||
> A tiny (228B) utility for constructing `className` strings conditionally.<Br>Also serves as a [faster](/bench) & smaller drop-in replacement for the `classnames` module. | ||
> A tiny (234B) utility for constructing `className` strings conditionally.<Br>Also serves as a [faster](/bench) & smaller drop-in replacement for the `classnames` module. | ||
@@ -81,3 +81,24 @@ This module is available in three formats: | ||
## Tailwind Support | ||
Here some additional (optional) steps to enable classes autocompletion using `clsx` with Tailwind CSS. | ||
<details> | ||
<summary> | ||
Visual Studio Code | ||
</summary> | ||
1. [Install the "Tailwind CSS IntelliSense" Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) | ||
2. Add the following to your [`settings.json`](https://code.visualstudio.com/docs/getstarted/settings): | ||
```json | ||
{ | ||
"tailwindCSS.experimental.classRegex": [ | ||
["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"] | ||
] | ||
} | ||
``` | ||
</details> | ||
## Related | ||
@@ -84,0 +105,0 @@ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
6792
8
8
110
1