Skip to content

Color slugs are not working in Otter Blocks #2742

@selul

Description

@selul

Description

Currently if we reference in the color attributes a color slug from the theme.json Otter is not using that and is reverting to the defaults

Similar with the core blocks it should use the slug name when that is used as value.

Step-by-step reproduction instructions

  1. Pick a color slug form theme.json, let's say base
  2. Pick a core block, let's say button. You can use this snippet:
window.wp.data.dispatch('core/block-editor').insertBlocks(window.wp.blocks.createBlock(
        'core/paragraph',
         { textColor:"base", content:"Test"},
         []
       ))

You can see the paragraph color is used corectly.

  1. Pick a Otter block, lets say a heading. You can use this snippet:
window.wp.data.dispatch('core/block-editor').insertBlocks(window.wp.blocks.createBlock(
         'themeisle-blocks/advanced-heading',
          { headingColor:"base", content:"Test"},
          []
        ))

You can see that is not using the right color and is reverting to the default.

Screenshots, screen recording, code snippet or Help Scout ticket

No response

Environment info

No response

Is the issue you are reporting a regression

No

Metadata

Metadata

Assignees

Labels

bugThis label could be used to identify issues that are caused by a defect in the product.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions