This page covers what changes when moving between Tailwind CSS versions withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/toolwind/anchors/llms.txt
Use this file to discover all available pages before exploring further.
@toolwind/anchors, as well as any breaking changes introduced in the plugin itself. The plugin supports Tailwind v3 and v4 simultaneously — but the two versions have meaningful syntax differences that affect how some utility classes behave.
@toolwind/anchors declares a peer dependency of tailwindcss >= 3.0.0 || >= 4.0.0. You do not need separate installs for different Tailwind versions — the same package adapts its behavior at runtime based on which version of Tailwind is running.Differences between Tailwind v3 and v4
1. Import method
How you register the plugin differs between versions.- Tailwind v4
- Tailwind v3
In v4, plugins are registered via a CSS
@import statement in your main stylesheet.2. Variable shorthand syntax
Both versions support a shorthand for referencing CSS custom properties as anchor names, but the delimiter character differs.- Tailwind v4
- Tailwind v3
In v4, use parentheses for the variable shorthand:
anchor/(--x)3. Arbitrary bracket syntax — a common gotcha
In Tailwind v3, square brackets were used for both arbitrary values and variable shorthand. A value like[--my-anchor] was interpreted as variable shorthand — it expanded to var(--my-anchor).
In Tailwind v4, parentheses handle variable shorthand exclusively, so [--my-anchor] is treated as an arbitrary value and the dashed ident is used directly, without wrapping in var().
- Tailwind v4
- Tailwind v3
Equivalent expressions cheat sheet
| Intent | Tailwind v4 | Tailwind v3 |
|---|---|---|
| Plain ident (auto-prefixed) | anchor/my-name | anchor/my-name |
| Dashed ident directly | anchor/--my-name | anchor/--my-name |
| Dashed ident via arbitrary | anchor/[--my-name] | (not the same — see above) |
| Reference CSS variable | anchor/(--x) | anchor/[--x] |
| Full var() arbitrary | anchor/[var(--x)] | anchor/[var(--x)] |
Changes in @toolwind/anchors itself
The current release is v1.0.10. The plugin’s public API has been stable since initial release. No utility names have been renamed or removed across patch versions. The most significant internal change was adding first-class detection of the Tailwind version at runtime (v3 vs. v4) to handle the syntax differences described above.
If you are upgrading from a pre-1.0 version, review the README for any notes specific to that transition, as early pre-release builds may have used different class name patterns.
Further reading
- Installation — step-by-step setup for both Tailwind versions
- Anchor Name — full naming syntax reference including variable shorthand
- Utility Index — complete class listing