Skip to content

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Jul 18, 2025

Fixes tailwindlabs/tailwindcss-typography#384

Basically when addUtilities/addComponents/matchUtilities/matchComponents saw a value of false it was being output instead of being discarded like it was in v3.

The types really require these to be strings but for things like the typography plugin this isn't really carried through from its theme config so it was easy to put anything in there and not realize it doesn't match the expected types.

Basically this:

addUtilities({
  '.foo': {
    a: 'red',
    'z-index': 0,
    '.bar': false,
    '.baz': null, // this one already worked
    '.qux': undefined,
  },
})

Now works like it did in v3 and omits .bar, .baz, and .qux

@thecrypticace thecrypticace requested a review from a team as a code owner July 18, 2025 18:26
@thecrypticace thecrypticace merged commit fa3f45f into main Jul 21, 2025
7 checks passed
@thecrypticace thecrypticace deleted the fix/ignore-false-in-css-objects branch July 21, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String selectors broken in Typography plugin after upgrading to Tailwind CSS v4
2 participants