From 504ab606b7e906537028515e8b033ed5ed6a0d9b Mon Sep 17 00:00:00 2001 From: Dany Castillo <31006608+dcastil@users.noreply.github.com> Date: Sun, 21 May 2023 12:11:26 +0200 Subject: [PATCH] add overview to docs and link to it from every docs page --- docs/README.md | 34 ++++++++++++++++++++++++++++++++++ docs/api-reference.md | 2 ++ docs/configuration.md | 2 ++ docs/contributing.md | 2 ++ docs/features.md | 2 ++ docs/recipes.md | 2 ++ docs/similar-packages.md | 2 ++ docs/versioning.md | 2 ++ docs/what-is-it-for.md | 2 +- docs/writing-plugins.md | 2 ++ 10 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 docs/README.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..ccb23789 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,34 @@ +
+
+ + tailwind-merge + +
+ +# tailwind-merge + +Utility function to efficiently merge [Tailwind CSS](https://tailwindcss.com) classes in JS without style conflicts. + +```ts +import { twMerge } from 'tailwind-merge' + +twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]') +// → 'hover:bg-dark-red p-3 bg-[#B91C1C]' +``` + +- Supports Tailwind v3.0 up to v3.3 (if you use Tailwind v2, use [tailwind-merge v0.9.0](https://github.com/dcastil/tailwind-merge/tree/v0.9.0)) +- Works in all modern browsers and Node >=12 +- Fully typed +- [Check bundle size on Bundlephobia](https://bundlephobia.com/package/tailwind-merge) + +## Get started + +- [What is it for](./what-is-it-for.md) +- [Features](./features.md) +- [Configuration](./configuration.md) +- [Recipes](./recipes.md) +- [API reference](./api-reference.md) +- [Writing plugins](./writing-plugins.md) +- [Versioning](./versioning.md) +- [Contributing](./contributing.md) +- [Similar packages](./similar-packages.md) diff --git a/docs/api-reference.md b/docs/api-reference.md index 979bbe9c..4c77b6aa 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -262,3 +262,5 @@ TypeScript type for config object. Useful if you want to build a `createConfig` Next: [Writing plugins](./writing-plugins.md) Previous: [Recipes](./recipes.md) + +[Back to overview](./README.md) diff --git a/docs/configuration.md b/docs/configuration.md index 5016bdf1..b453005c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -239,3 +239,5 @@ const twMerge3 = createTailwindMerge(() => ({ … }), withMagic, withMoreMagic) Next: [Recipes](./recipes.md) Previous: [Features](./features.md) + +[Back to overview](./README.md) diff --git a/docs/contributing.md b/docs/contributing.md index fbb48c0b..f970f76b 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -7,3 +7,5 @@ Please see [CONTRIBUTING](../.github/CONTRIBUTING.md) for details. Next: [Similar packages](./similar-packages.md) Previous: [Versioning](./versioning.md) + +[Back to overview](./README.md) diff --git a/docs/features.md b/docs/features.md index b89ce84b..96e7997c 100644 --- a/docs/features.md +++ b/docs/features.md @@ -150,3 +150,5 @@ The initial computations are called lazily on the first call to `twMerge` to pre Next: [Configuration](./configuration.md) Previous: [What is it for](./what-is-it-for.md) + +[Back to overview](./README.md) diff --git a/docs/recipes.md b/docs/recipes.md index 58a8cb24..bf0f5d41 100644 --- a/docs/recipes.md +++ b/docs/recipes.md @@ -85,3 +85,5 @@ function customTwMerge(...inputs) { Next: [API reference](./api-reference.md) Previous: [Configuration](./configuration.md) + +[Back to overview](./README.md) diff --git a/docs/similar-packages.md b/docs/similar-packages.md index fa97f14c..43dad4c4 100644 --- a/docs/similar-packages.md +++ b/docs/similar-packages.md @@ -15,3 +15,5 @@ --- Previous: [Contributing](./contributing.md) + +[Back to overview](./README.md) diff --git a/docs/versioning.md b/docs/versioning.md index 506bafee..d4a9ae89 100644 --- a/docs/versioning.md +++ b/docs/versioning.md @@ -21,3 +21,5 @@ This package follows the [SemVer](https://semver.org) versioning rules. More spe Next: [Contributing](./contributing.md) Previous: [Writing plugins](./writing-plugins.md) + +[Back to overview](./README.md) diff --git a/docs/what-is-it-for.md b/docs/what-is-it-for.md index 3343ff2f..b7c02d33 100644 --- a/docs/what-is-it-for.md +++ b/docs/what-is-it-for.md @@ -38,4 +38,4 @@ tailwind-merge overrides conflicting classes and keeps everything else untouched Next: [Features](./features.md) -Previous: [Overview](../README.md) +[Back to overview](./README.md) diff --git a/docs/writing-plugins.md b/docs/writing-plugins.md index 38ac7882..1d00dae5 100644 --- a/docs/writing-plugins.md +++ b/docs/writing-plugins.md @@ -37,3 +37,5 @@ Also, feel free to check out [tailwind-merge-rtl-plugin](https://www.npmjs.com/p Next: [Versioning](./versioning.md) Previous: [API reference](./api-reference.md) + +[Back to overview](./README.md)