tailwindcss/packages
Philipp Spiess dd85aadc2c
Reintroduce container component as a utility (#14993)
Closes #13129

We're adding back the v3 `container` component, this time as a utility.
The idea is that we support the default `container` behavior but we will
not have an API to configure this similar to what v3 offered. Instead,
the recommended approach is to configure it by creating a custom utility
like so:

```css
@import "tailwindcss";

@utility container {
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}
```

We do have an idea of how to migrate existing JS configuration files to
the new `@utility` as part of the interop layer and the codemod. This is
going to be a follow-up PR though.

## Test Plan

We added a unit test but we've also played around with it in the Vite
playground. Yep, looks like a `container`:


https://github.com/user-attachments/assets/ea7a5a4c-4cde-4ef5-9062-03e16239eb85

---------

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2024-11-13 13:39:20 -05:00
..
@tailwindcss-cli Upgrade @parcel/watcher to 2.5.0 (#14978) 2024-11-13 11:38:43 +01:00
@tailwindcss-node Prepare v4.0.0-alpha.33 release (#14967) 2024-11-11 20:28:41 -05:00
@tailwindcss-postcss Prepare v4.0.0-alpha.33 release (#14967) 2024-11-11 20:28:41 -05:00
@tailwindcss-standalone Update @types/bun 1.1.11 → 1.1.13 (patch) (#14936) 2024-11-13 11:56:58 +01:00
@tailwindcss-upgrade Prepare v4.0.0-alpha.33 release (#14967) 2024-11-11 20:28:41 -05:00
@tailwindcss-vite Vite: Don't track candidate changes for Svelte <style> tags (#14981) 2024-11-13 16:42:49 +01:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Reintroduce container component as a utility (#14993) 2024-11-13 13:39:20 -05:00
tsconfig.base.json introduce v4 codebase 2024-03-05 14:29:15 +01:00