Minor Changes
-
bc09d89: Add support for deprecating tokens, utilities, patterns and config recipes.
Set the
deprecated
property totrue
to enable deprecation warnings. Alternatively, you can also set it to a string
to provide a custom migration message.Deprecating a utility
defineConfig({ utilities: { ta: { deprecated: true, transform(value) { return { textAlign: value }; }, }, }, });
Deprecating a token
defineConfig({ theme: { tokens: { spacing: { lg: { value: "8px", deprecated: "use `8` instead" }, }, }, }, });
Deprecating a pattern
defineConfig({ patterns: { customStack: { deprecated: true, }, }, });
Deprecating a recipe
defineConfig({ theme: { recipes: { btn: { deprecated: "will be removed in v2.0", }, }, }, });
ESLint Plugin
These deprecation warnings will translated into the ESLint plugin as a
no-deprecated
rule.{ "rules": { "no-deprecated": "warn" } }
In the next release of the ESLint plugin, you will get a warning when using deprecated tokens or utilities.