tailwindcss/packages
Philipp Spiess d1fd645beb
Proposal: Allow overwriting static utilities that have a namespace (#18056)
This PR attempts to move static utilities that are overwriteable by a
theme value to be a fallback rather than a conflicting implementation.
The idea is to allow a theme value to take presedence over that static
utility _and cause it not to generate_.

For example, when overwriting the `--radius-full` variant, it should
ensure that the default `rounded-full` no longer emits the
`calc(infinity * 1px)` declaration:

```ts
expect(
  await compileCss(
    css`
      @theme {
        --radius-full: 99999px;
      }
      @tailwind utilities;
    `,
    ['rounded-full'],
  ),
).toMatchInlineSnapshot(`
  ":root, :host {
    --radius-full: 99999px;
  }

  .rounded-full {
    border-radius: var(--radius-full);
  }"
`)
```

This allows anyone who wants `--radius-full` to be a CSS variable to
simply define it in their theme:

```css
@theme {
  /* Make `--radius-full` a CSS variable without the utility generating two CSS classes */
  --radius-full: calc(infinity * 1px);
}
```

The idea is to extend this pattern across all functional utilities that
also have static utilities that can collide with the namespace. This
gives users more control over what they want as CSS variables when the
defaults don't work for them, allowing them to resolve #16639 and #15115
in user space.

You may now find yourself thinking "but Philipp, why would someone want
to be able to overwrite `--animate-none`. `none` surely always will mean
no animation" and I would agree [but it's already possible right now
anyways so this is not a new behavior! This PR just cleans up the
generated output.](https://play.tailwindcss.com/StnQqm4V2e)

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-09-11 12:21:50 +02:00
..
@tailwindcss-browser Prepare v4.1.13 release (#18868) 2025-09-04 13:18:25 -04:00
@tailwindcss-cli Fix CLI watcher cleanup race (#18905) 2025-09-09 17:14:09 +02:00
@tailwindcss-node Prepare v4.1.13 release (#18868) 2025-09-04 13:18:25 -04:00
@tailwindcss-postcss Prepare v4.1.13 release (#18868) 2025-09-04 13:18:25 -04:00
@tailwindcss-standalone Prepare v4.1.13 release (#18868) 2025-09-04 13:18:25 -04:00
@tailwindcss-upgrade Prepare v4.1.13 release (#18868) 2025-09-04 13:18:25 -04:00
@tailwindcss-vite Prepare v4.1.13 release (#18868) 2025-09-04 13:18:25 -04:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Proposal: Allow overwriting static utilities that have a namespace (#18056) 2025-09-11 12:21:50 +02:00
tsconfig.base.json Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00