packages/codemods/v5-0-0/02-migrate-properties-style.md
properties.style → style: { .element }In the old system, inline styles on a block's root element lived under properties.style. In Lowdefy v4.8, all styling moves to a top-level style: block with .-prefixed slot keys. The root element slot is .element.
The build auto-normalizes properties.style with a deprecation warning, but migrating now produces cleaner configs.
For each block that has a style: key under properties::
style: entry from properties:style: block (at the same level as properties:) with the content nested under .element:If the block already has a top-level style: block, merge the .element entry into it.
Glob: **/*.{yaml,yml}
Grep: properties: then check for style: child
- id: header
type: Box
properties:
style:
backgroundColor: '#f0f0f0'
padding: 16
- id: header
type: Box
style:
.element:
backgroundColor: '#f0f0f0'
padding: 16
- id: divider
type: Divider
properties:
style: { marginTop: 24, marginBottom: 24 }
- id: divider
type: Divider
style:
.element: { marginTop: 24, marginBottom: 24 }
- id: card
type: Card
properties:
title: My Card
style:
borderRadius: 8
bordered: true
- id: card
type: Card
properties:
title: My Card
bordered: true
style:
.element:
borderRadius: 8
style: keys that are already at the block top level (not under properties:)style: with other . slots, add .element to it rather than creating a duplicate style: blockstyle: inside markdown code blocks, string values, or _ref contentstyle: (like _if, _state) should be moved as-isgrep -rn 'properties:' --include='*.yaml' --include='*.yml' . -A 5 | grep 'style:'
No style: should appear as a child of properties: after migration.