AlleyFord / schematic

Javascript-driven, Shopify CLI-friendly, grunt/webpack/etc-friendly schema management
15 stars 1 forks source link

✨ update section method to receive props object, with sane defaults #5

Closed jacobkossman closed 8 months ago

jacobkossman commented 8 months ago

Existing section method could not receive additional props like class, presets etc. This enables the following:

module.exports = {
  ...app.section('Section Name', {
    class: 'section',
    tag: 'div',
    presets: [
      {
        name: "Section Preset Name",
        blocks: [
          {
            type: "heading"
          },
          {
            type: "paragraph"
          },
        ]
      }      
    ]
  }),
  settings: [...],
  blocks: [...]
}