Edge cases
Every case, before and after
Each case is real codemod output. Both versions render in this page with Tailwind's own CSS, and every element's computed style is compared. A green dot means they render the same.
79cases
51moved to className
24stay, with a reason
...render the same
- Dashed line: box edge
- Hatch: padding
- Tint: content
Cases that use theme tokens are checked against the token shown on their card, inside @theme { }. Class sizes use 16px per rem, as Uniwind does.
Press state
Pressable styles that read pressed or hovered. 3 cases.
Pressed array becomes active class
Moved to className.
Pressed callback that reads hovered stays
Left as StyleSheet, on purpose.
stays: used outside style prop (3 styles)
Pressed ternary becomes plain and active classes
Moved to className.
Conditions and class merge
Ternaries, && parts and arrays, with and without a class merge function. 10 cases.
And member becomes class merge argument
Moved to className.
class merge: cn
Class merge import is not added twice
Moved to className.
class merge: cn
Conditional without class merge stays
Moved to className.
stays: conditional without class merge
File with its own cn name stays
Left as StyleSheet, on purpose.
stays: conditional without class mergeclass merge: cn
Plain use needs no class merge
Moved to className.
Static array flattens
Moved to className.
Style const with condition uses class merge
Moved to className.
Ternary becomes class merge ternary
Moved to className.
class merge: cn
Ternary with empty branch becomes class merge ternary
Moved to className.
class merge: cn
Two conditions become two class merge arguments
Moved to className.
class merge: cn
Components
Your own components, Reanimated, gradients and content container styles. 11 cases.
Color prop on host component stays
Left as StyleSheet, on purpose.
Content container style becomes class name
Moved to className.
Existing static class name gets classes added
Moved to className.
Imported component ignoring class name stays
Left as StyleSheet, on purpose.
stays: component has no class name
Imported component reading class name gets class name
Moved to className.
Imported component with base style stays
Left as StyleSheet, on purpose.
stays: component has no class name
Linear gradient has no class name
Left as StyleSheet, on purpose.
stays: component has no class name
Own component with class name prop gets class name
Moved to className.
Own component without class name prop stays
Left as StyleSheet, on purpose.
stays: component has no class name
Reanimated view gets class name
Moved to className.
Style order and props
Caller styles, spread props and element shapes. 5 cases.
Caller style before sheet style flips order
Left as StyleSheet, on purpose.
stays: style order would flip
Caller style still wins
Moved to className.
Props after style are kept
Moved to className.
Props before style are kept
Moved to className.
Self closing and wrapping elements
Moved to className.
Values to classes
Each style value and the class it becomes. 29 cases.
Absolute fill stays unchanged
Left as StyleSheet, on purpose.
Absolute position with offsets
Moved to className.
Border width and color
Moved to className.
Card rule moves to classes
Moved to className.
Center content
Moved to className.
Color names become background and border classes
Moved to className.
@theme --color-surface: #ffffff;
--color-line: #e2e8f0;
Elevation has no class
Left as StyleSheet, on purpose.
stays: no exact class
Flex row with gap
Moved to className.
Flex wrap and align self
Moved to className.
Font size 17 without arbitrary values has no class
Left as StyleSheet, on purpose.
stays: no exact class
Font size alone is arbitrary
Moved to className.
arbitrary values on
Font size with line height is text size
Moved to className.
Hairline width stays dynamic
Left as StyleSheet, on purpose.
stays: dynamic value
Left and right margins become logical
Moved to className.
Margin and margin horizontal conflict
Left as StyleSheet, on purpose.
stays: family conflict
Module constant width has no exact class
Left as StyleSheet, on purpose.
stays: no exact class
Negative margin
Moved to className.
Opacity half
Moved to className.
Overflow hidden
Moved to className.
Padding and padding top conflict
Left as StyleSheet, on purpose.
stays: family conflict
Padding left and right in one rule stay as family conflict
Left as StyleSheet, on purpose.
stays: family conflict
Percent width
Moved to className.
Rounded full border radius
Moved to className.
Shadow offset has no class
Left as StyleSheet, on purpose.
stays: no exact class
Split keeps dynamic width in style
Moved to className.
Text align center
Moved to className.
Text style moves on text
Moved to className.
Theme color becomes token class
Moved to className.
@theme --color-brand: #6d28d9;
Zero padding
Moved to className.
Files, sheets and style consts
Sheets shared across files, style constants and what stays. 21 cases.
Color name becomes theme class
Moved to className.
@theme --color-ink-soft: #64748b;
Color name missing from theme stays
Left as StyleSheet, on purpose.
stays: color name not in theme@theme --color-ink: #0f172a;
Create styles wrapper and hook are removed
Moved to className.
Empty rule is unchanged
Left as StyleSheet, on purpose.
stays: dynamic value
Exported sheet is skipped
Left as StyleSheet, on purpose.
File without style sheet is unchanged
Left as StyleSheet, on purpose.
Flatten call keeps rule
Left as StyleSheet, on purpose.
stays: used outside style prop
Inline style object without sheet stays unchanged
Left as StyleSheet, on purpose.
Nested color name becomes theme class
Moved to className.
@theme --color-brand: #6d28d9;
One rule used twice moves both
Moved to className.
Platform select stays
Left as StyleSheet, on purpose.
stays: dynamic value
Scheme wrapper stays unchanged
Left as StyleSheet, on purpose.
stays: scheme wrapper
Sheet with no uses is unchanged
Left as StyleSheet, on purpose.
Style const passed to function stays
Left as StyleSheet, on purpose.
stays: used outside style prop
Style const used only as style becomes class name const
Moved to className.
Style property read in code keeps rule
Moved to className.
stays: used outside style prop
Style without sheet reference unchanged
Left as StyleSheet, on purpose.
Two rules two elements
Moved to className.
Unmapped color stays while mapped color moves
Moved to className.
stays: no exact class@theme --color-ink: #0f172a;
Untouched lines keep their spacing
Moved to className.
Unused sheet rule is kept when one rule moves
Moved to className.