Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dcastil/tailwind-merge
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.14.0
Choose a base ref
...
head repository: dcastil/tailwind-merge
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.0
Choose a head ref
Loading
Showing with 4,480 additions and 4,807 deletions.
  1. +7 −4 .github/workflows/codeql-analysis.yml
  2. +5 −5 .github/workflows/npm-publish-dev.yml
  3. +5 −5 .github/workflows/npm-publish.yml
  4. +14 −1 .github/workflows/size.yml
  5. +5 −5 .github/workflows/test.yml
  6. +10 −2 .size-limit.json
  7. +12 −11 README.md
  8. +1 −0 docs/README.md
  9. +160 −58 docs/api-reference.md
  10. +196 −0 docs/changelog/v0-changelog.md
  11. +32 −0 docs/changelog/v0-to-v1-migration.md
  12. +364 −0 docs/changelog/v1-changelog.md
  13. +472 −0 docs/changelog/v1-to-v2-migration.md
  14. +43 −0 docs/changelog/v2-changelog.md
  15. +74 −20 docs/configuration.md
  16. +2 −2 docs/features.md
  17. +21 −0 docs/limitations.md
  18. +14 −18 docs/recipes.md
  19. +5 −3 docs/writing-plugins.md
  20. +43 −23 package.json
  21. +7 −0 scripts/jest.config.mjs
  22. +124 −0 scripts/rollup.config.mjs
  23. +1 −1 scripts/test-built-package-exports.mjs
  24. +1 −8 src/index.ts
  25. +25 −13 src/lib/class-utils.ts
  26. +2 −2 src/lib/config-utils.ts
  27. +7 −8 src/lib/create-tailwind-merge.ts
  28. +61 −27 src/lib/default-config.ts
  29. +12 −4 src/lib/extend-tailwind-merge.ts
  30. +7 −3 src/lib/from-theme.ts
  31. +53 −32 src/lib/merge-configs.ts
  32. +3 −3 src/lib/modifier-utils.ts
  33. +363 −12 src/lib/types.ts
  34. +37 −41 src/lib/validators.ts
  35. +8 −0 tests/arbitrary-values.test.ts
  36. +1 −1 tests/class-map.test.ts
  37. +13 −0 tests/conflicts-across-class-groups.test.ts
  38. +4 −0 tests/create-tailwind-merge.test.ts
  39. +3 −2 tests/default-config.test.ts
  40. +55 −18 tests/extend-tailwind-merge.test.ts
  41. 0 tests/{lazy-initializaton.test.ts → lazy-initialization.test.ts}
  42. +52 −8 tests/merge-configs.test.ts
  43. +1 −0 tests/modifiers.test.ts
  44. +22 −17 tests/public-api.test.ts
  45. +13 −9 tests/theme.test.ts
  46. +181 −0 tests/type-generics.test.ts
  47. +24 −18 tests/validators.test.ts
  48. +1 −1 tsconfig.json
  49. +1,914 −4,422 yarn.lock
11 changes: 7 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -16,15 +16,18 @@ jobs:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.17.1
- name: Use node_modules cache
uses: actions/cache@v3
with:
path: node_modules
key: yarn-node-16-lock-${{ hashFiles('yarn.lock') }}
key: yarn-node-18-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-node-16-lock-
yarn-node-18-lock-
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
10 changes: 5 additions & 5 deletions .github/workflows/npm-publish-dev.yml
Original file line number Diff line number Diff line change
@@ -10,20 +10,20 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18.17.1
# More info: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
registry-url: 'https://registry.npmjs.org'
- name: Use node_modules cache
uses: actions/cache@v3
with:
path: node_modules
key: yarn-node-16-lock-${{ hashFiles('yarn.lock') }}
key: yarn-node-18-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-node-16-lock-
yarn-node-18-lock-
- run: yarn install --frozen-lockfile
- run: yarn build
- uses: actions/upload-artifact@v3
10 changes: 5 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -10,18 +10,18 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18.17.1
- name: Use node_modules cache
uses: actions/cache@v3
with:
path: node_modules
key: yarn-node-16-lock-${{ hashFiles('yarn.lock') }}
key: yarn-node-18-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-node-16-lock-
yarn-node-18-lock-
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test --ci --coverage --maxWorkers=2
15 changes: 14 additions & 1 deletion .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,20 @@ jobs:
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.17.1
- name: Use node_modules cache
uses: actions/cache@v3
with:
path: node_modules
key: yarn-node-18-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-node-18-lock-
- run: yarn install --frozen-lockfile
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_step: install
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -10,18 +10,18 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18.17.1
- name: Use node_modules cache
uses: actions/cache@v3
with:
path: node_modules
key: yarn-node-16-lock-${{ hashFiles('yarn.lock') }}
key: yarn-node-18-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-node-16-lock-
yarn-node-18-lock-
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test --ci --coverage --maxWorkers=2
12 changes: 10 additions & 2 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
[
{
"path": "dist/tailwind-merge.mjs",
"path": "dist/bundle-mjs.mjs",
"limit": "10 KB"
},
{
"path": "dist/tailwind-merge.cjs.production.min.js",
"path": "dist/bundle-cjs.js",
"limit": "10 KB"
},
{
"path": "dist/es5/bundle-mjs.mjs",
"limit": "20 KB"
},
{
"path": "dist/es5/bundle-cjs.js",
"limit": "20 KB"
}
]
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<div align="center">
<br />
<a href="https://github.com/dcastil/tailwind-merge">
<img src="https://github.com/dcastil/tailwind-merge/raw/v1.14.0/assets/logo.svg" alt="tailwind-merge" height="150px" />
<img src="https://github.com/dcastil/tailwind-merge/raw/v2.0.0/assets/logo.svg" alt="tailwind-merge" height="150px" />
</a>
</div>

@@ -25,13 +25,14 @@ twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')

## Get started

- [What is it for](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/what-is-it-for.md)
- [When and how to use it](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/when-and-how-to-use-it.md)
- [Features](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/features.md)
- [Configuration](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/configuration.md)
- [Recipes](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/recipes.md)
- [API reference](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/api-reference.md)
- [Writing plugins](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/writing-plugins.md)
- [Versioning](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/versioning.md)
- [Contributing](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/contributing.md)
- [Similar packages](https://github.com/dcastil/tailwind-merge/tree/v1.14.0/docs/similar-packages.md)
- [What is it for](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/what-is-it-for.md)
- [When and how to use it](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/when-and-how-to-use-it.md)
- [Features](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/features.md)
- [Limitations](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/limitations.md)
- [Configuration](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/configuration.md)
- [Recipes](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/recipes.md)
- [API reference](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/api-reference.md)
- [Writing plugins](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/writing-plugins.md)
- [Versioning](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/versioning.md)
- [Contributing](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/contributing.md)
- [Similar packages](https://github.com/dcastil/tailwind-merge/tree/v2.0.0/docs/similar-packages.md)
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
- [What is it for](./what-is-it-for.md)
- [When and how to use it](./when-and-how-to-use-it.md)
- [Features](./features.md)
- [Limitations](./limitations.md)
- [Configuration](./configuration.md)
- [Recipes](./recipes.md)
- [API reference](./api-reference.md)
Loading