Skip to main content

A comprehensive Python port of tailwind-merge - intelligently merge Tailwind CSS classes

Project description

starMERGE

A comprehensive Python port of tailwind-merge - intelligently merge Tailwind CSS classes without style conflicts.

Description

starmerge is a utility function to efficiently merge Tailwind CSS classes in Python without style conflicts. This is a complete port of the popular JavaScript library tailwind-merge.

from starmerge import merge

merge("px-2 py-1 bg-red hover:bg-dark-red", "p-3 bg-[#B91C1C]")
# → 'hover:bg-dark-red p-3 bg-[#B91C1C]'

Installation

pip install starmerge

Features

  • ✅ Full class merging functionality with conflict resolution
  • ✅ Support for Tailwind v4.x syntax
  • ✅ Handles arbitrary values, modifiers, and variants
  • ✅ Comprehensive test coverage matching the original library
  • ✅ Production-ready and battle-tested

Requirements

  • Python 3.11+
  • Works with Tailwind CSS v4.x

Contributing

Contributions are welcome! Feel free to open issues for bugs or unexpected behavior, or submit pull requests with improvements.

Credits

This is a port of tailwind-merge by Dany Castillo. All credit for the original implementation goes to the original authors.

License

Licensed under the MIT License. This is a port of tailwind-merge which is also licensed under the MIT License.

Disclaimer

This is an independent port and is not officially affiliated with or endorsed by the original tailwind-merge project or Tailwind CSS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starmerge-0.2.0.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starmerge-0.2.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file starmerge-0.2.0.tar.gz.

File metadata

  • Download URL: starmerge-0.2.0.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for starmerge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0dc8155212825750e5780ed123ef450cb016ba58cc6145dbea69b26a303f86e3
MD5 f8054598149dd7a61f32ab7d743b31b4
BLAKE2b-256 115ee5dd718d0b92c57eaf1101e4d605354396e881ef57126ff11e66e138f3aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for starmerge-0.2.0.tar.gz:

Publisher: release.yml on banditburai/starmerge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file starmerge-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: starmerge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for starmerge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36e12356652a0729ac3017b0c4bd4315dba205b5ba97f98009c260d9d840c127
MD5 1ab3efe76a6da1534b62a6252eba5f38
BLAKE2b-256 1b807402d05d94350c5bce32fe2cf2b184cde0c1ffb094f3524931f9ae715ac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for starmerge-0.2.0-py3-none-any.whl:

Publisher: release.yml on banditburai/starmerge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page