packages/codemods/v5-0-0/19-responsive-style-breakpoints.md
Lowdefy v4 supported responsive breakpoint keys inside style: blocks (e.g., sm:, md:, lg:). This feature is removed in v4.8 — responsive styling now uses Tailwind utility classes via the new class property.
For each block that uses responsive breakpoint keys inside style:, convert the responsive styles to equivalent Tailwind utility classes on the class property.
| CSS Property | Tailwind Prefix | Example |
|---|---|---|
padding | p- | padding: 16 → p-4 |
margin | m- | margin: 8 → m-2 |
display: none | hidden | |
display: block | block | |
display: flex | flex | |
fontSize | text- | fontSize: 24 → text-2xl |
width | w- | width: '100%' → w-full |
gap | gap- | gap: 16 → gap-4 |
Tailwind breakpoint prefixes: sm:, md:, lg:, xl:, 2xl:
style: blocks with breakpoint keys (sm:, md:, lg:, xl:, xxl: / 2xl:)class property (create if it doesn't exist)style:style: becomes empty after removing breakpoints, remove the style: block entirelyGlob: **/*.{yaml,yml}
Grep: sm:|md:|lg:|xl:|2xl:|xxl: (within style: blocks on Lowdefy blocks)
Important: layout.sm.span (antd Col responsive) is NOT affected — only style.sm.* breakpoints are removed. Don't touch responsive keys under layout:.
- id: container
type: Box
style:
padding: 64
sm:
padding: 32
md:
padding: 48
- id: container
type: Box
class: p-16 sm:p-8 md:p-12
- id: sidebar
type: Box
style:
display: none
md:
display: block
- id: sidebar
type: Box
class: hidden md:block
- id: card
type: Card
style:
/element:
borderRadius: 8
fontSize: 24
sm:
fontSize: 16
- id: card
type: Card
style:
/element:
borderRadius: 8
class: text-2xl sm:text-base
class: "p-[17px] sm:p-[9px]"class property, append the responsive classes to itpadding: 16 → p-4, margin: 8 → m-2grep -rn 'sm:\|md:\|lg:\|xl:\|2xl:' --include='*.yaml' --include='*.yml' . | grep -v layout | grep -v node_modules
Remaining matches should only be inside layout: blocks (which are not affected) or non-Lowdefy YAML files.