Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update packages/@tailwindcss-upgrade/src/template/codemods/theme-to-v…
…ar.ts
  • Loading branch information
adamwathan authored Nov 8, 2024
commit eac784894aae35d95ce90efa93b20cd2c8bac6bc
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ export function createConverter(designSystem: DesignSystem, { prettyPrint = fals
// which means that we can typically convert them to a modifier on the
// candidate itself.
//
// If however the `theme(…)` is used with a color, and other ast nodes
// exists then we don't want to handle it as a modifier because it's not
// guaranteed that the value is a color.
// If there is more than one node in the AST though, `theme(…)` must not
// be the whole value so it's not safe to use a modifier instead.
//
// E.g.: `inset 0px 1px theme(colors.red.500/50%)` is a shadow, not a color.
if (ast.length === 1 && parts.length === 2 && options & Convert.MigrateModifier) {
Expand Down