Skip to content

Cover Block: Inline styling doesn't add a closing semicolon #48258

@jamesozzie

Description

@jamesozzie

Description

When using the "Cover" block (and possibly others) and applying some configuration changes that result in inline styling (ie - You can set the "Focal Point Picker"), this styling is added without a closing semi colon. This means that any third party plugins that also add inline styling to the same element may have their rules merged with an existing rule, rendering it not functioning.

Below: Example of inline styling with the Cover block - notice there is no closing semi colon:

image

Below: Example of inline styling with the Cover block, with another plugin that also adds it's own inline styling to the same element - there is no distinction between the rules, they're merged.

image

Step-by-step reproduction instructions

  1. Add a cover block
  2. To ensure there is inline styling added, change the "Focal Point Picker", as per this recording. In this case, the inline styling will appear similar to: style="object-position:22% 59%"
  3. Check your sites source code, notice the inline styling isn't closed (doesn't have a semi colon)
  4. Add styling via another plugin (for example install the Performance Lab plugin and enable the "Dominants Color module"
  5. The styling added via the dominant color is merged with the Cover block styling, rendering both not working

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSS StylingRelated to editor and front end styles, CSS-specific issues.[Block] CoverAffects the Cover Block - used to display content laid over a background image[Package] Element/packages/element[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions