• Why does the gallery block add an alignment class, instead of a data attribute?

    I’m applying a custom stylesheet with style for an “alignwide” class. My style doesn’t affect any other blocks, except for the gallery block. Is there a reason the gallery block isn’t using a data attribute to set alignment?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It would be unusual to use data attributes to dictate CSS styles. CSS selectors are intended to use elements. classes, and IDs only, not data attributes. You can add any class attribute you want to a gallery block, or style all of them strictly by ul.wp-block-gallery alone. There’s no reason to add data attributes into the mix.

Viewing 1 replies (of 1 total)
  • The topic ‘Gallery Block Alignment: Class vs. Data Attribute’ is closed to new replies.