npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tailwind-merge-typography

v1.0.1

Published

A tailwind-merge plugin that teaches twMerge to resolve @tailwindcss/typography prose-* conflicts.

Readme

tailwind-merge-typography

npm version CI coverage minzipped size license

Teach tailwind-merge how to resolve conflicts between @tailwindcss/typography prose-* classes, so conditional prose variants collapse to the last one instead of piling up.

tailwind-merge ships no knowledge of the typography plugin (it's a plugin, not core Tailwind), so out of the box it leaves conflicting prose classes untouched:

import { twMerge } from 'tailwind-merge'

twMerge('prose-sm prose-lg') // => 'prose-sm prose-lg'  (both kept, wrong)
twMerge('prose-gray prose-zinc') // => 'prose-gray prose-zinc'  (both kept, wrong)

With this plugin they resolve the way you'd expect:

import { extendTailwindMerge } from 'tailwind-merge'
import { withTypography } from 'tailwind-merge-typography'

const twMerge = extendTailwindMerge(withTypography)

twMerge('prose-sm prose-lg') // => 'prose-lg'
twMerge('prose-gray prose-zinc') // => 'prose-zinc'

Install

bun add tailwind-merge-typography

tailwind-merge is a peer dependency, so install it too if you haven't already:

bun add tailwind-merge

Usage

Wrap your twMerge once with extendTailwindMerge and use it everywhere (including inside a cn()/clsx helper):

import { extendTailwindMerge } from 'tailwind-merge'
import { withTypography } from 'tailwind-merge-typography'

export const twMerge = extendTailwindMerge(withTypography)

Size and color are independent groups, so they never clobber each other. Only same-group conflicts collapse:

twMerge('prose prose-lg prose-gray') // => 'prose prose-lg prose-gray'  (all independent)
twMerge('prose-gray prose-invert') // => 'prose-gray prose-invert'  (color + dark toggle)
twMerge('prose-blue prose-gray') // => 'prose-gray'  (both are colors)

withTypography composes with any other tailwind-merge plugins, in any order:

const twMerge = extendTailwindMerge(withTypography, someOtherPlugin)

Custom prose themes

Registered a custom color or size in your Tailwind config (say prose-brand or prose-3xl)? createTypographyPlugin appends them to the built-in defaults so they merge too:

import { extendTailwindMerge } from 'tailwind-merge'
import { createTypographyPlugin } from 'tailwind-merge-typography'

const twMerge = extendTailwindMerge(
  createTypographyPlugin({ colors: ['brand'], sizes: ['3xl'] }),
)

twMerge('prose-gray prose-brand') // => 'prose-brand'
twMerge('prose-lg prose-3xl') // => 'prose-3xl'

withTypography is just createTypographyPlugin() with no custom themes, so you never lose the 22 built-in colors or 5 built-in sizes by using the factory.

Element variants work automatically

Element modifiers like prose-a: and prose-headings: need no plugin code. tailwind-merge already dedupes any foo:-prefixed variant, so they resolve out of the box:

twMerge('prose-a:text-red-500 prose-a:text-blue-500') // => 'prose-a:text-blue-500'

Compatibility

One package serves both major Tailwind lines, because the prose-* class names and the tailwind-merge config API are identical across them:

| Tailwind CSS | tailwind-merge | | ------------ | -------------- | | v3 | v2 | | v4 | v3 |

The peer range is tailwind-merge >=2.0.0 <4.

Editor setup

This repo uses Biome for lint and format. Install the biomejs.biome extension and format-on-save is preconfigured in .vscode/settings.json (Cursor reads it too).

License

MIT © Leonid Svyatov