tailwindcss/packages/tailwindcss
Adam Wathan a4f8a36413
Don't unset keys like --font-weight-* when unsetting --font-* (#14906)
This PR fixes an issue where unsetting `--font-*` would unset
`--font-weight-*` and `--font-size-*`.

```css
@theme {
  --font-weight-bold: bold;
  --font-size-sm: 14px;
  --font-sans: sans-serif;
  --font-serif: serif;
}
@theme {
  --font-*: initial;
  --font-body: Inter;
}
```

Up until now this was sort of intended/desired behavior but with recent
changes there are now more overlapping theme keys (`--inset-*` and
`--inset-shadow-*` as well for example), and we don't want to make it
impossible to unset _just_ the default `font-family` values.

This PR also simplifies how we were handling making sure that the
`inset-*` utility ignored `--inset-shadow-*` variables since it's all
really the same problem.

This does mean we need to maintain a list of known theme keys so we know
when there is a conflict between two keys, which is kind of unfortunate
because up until now this was a totally dynamic thing. End users can
still add whatever custom stuff they want under `@theme` but we don't
really know about those namespaces since we're maintaining a static list
so we can't resolve conflicts there. I'm confident there are ways we
could solve this if it actually becomes a problem, so content to push
forward without solving it right now and just deal with it if/when it
actually arises, because it just might not.

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-11-07 10:43:49 -05:00
..
src Don't unset keys like --font-weight-* when unsetting --font-* (#14906) 2024-11-07 10:43:49 -05:00
tests Adjust shadow, radius, and blur scales to ensure all utilities have a value suffix (#14849) 2024-11-04 14:04:03 -05:00
index.css introduce v4 codebase 2024-03-05 14:29:15 +01:00
package.json Prepare v4.0.0-alpha.31 release (#14823) 2024-10-30 07:53:51 -04:00
playwright.config.ts Only apply hover on devices that support hover (#14500) 2024-09-24 11:43:57 -04:00
preflight.css Prepare preflight for border compatibility (#14745) 2024-10-22 16:18:13 +00:00
README.md Copy README file to every package (#13096) 2024-03-06 08:49:31 -05:00
theme.css Rename --width-* namespace to --container-* (#14898) 2024-11-06 20:50:30 -05:00
tsconfig.json introduce v4 codebase 2024-03-05 14:29:15 +01:00
tsup.config.ts Throw a useful error when tailwindcss is used as a PostCSS plugin (#14378) 2024-09-11 17:02:24 +02:00
utilities.css introduce v4 codebase 2024-03-05 14:29:15 +01:00
vitest.config.ts Add integration test setup and tests for the Vite integration (#14089) 2024-08-02 11:50:49 +02:00

Tailwind CSS

A utility-first CSS framework for rapidly building custom user interfaces.

Build Status Total Downloads Latest Release License


Documentation

For full documentation, visit tailwindcss.com.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discuss Tailwind CSS on GitHub

For chatting with others using the framework:

Join the Tailwind CSS Discord Server

Contributing

If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.