• Is there a way to set “Stack on Mobile” to be on sitewide versus having to select it for EACH image & text block that is added to content?

    This would be great on larger sites where this block may be used a number of times and where users might not know this needs to be added. Obviously, this can be achieved via CSS but curious if there is a function or switch to automatically add for a full site.

Viewing 4 replies - 1 through 4 (of 4 total)
  • There isn’t a setting in the editor to apply specific block settings by default side wide.
    Yes, you can certainly do this via CSS, but the cleaner version would be to do this with a small plugin that extends the existing block and make the attribute a default one for this new block. Here is the page in the developers handbook about extending core blocks
    With this solution you are to tight to a specific theme for the setting to work.

    Thread Starter Wes Linda

    (@weslinda)

    I appreciate the information. I feel like it would be better served to have an option to enable this within Gutenberg but I’ll dig into this approach and see if it will work as desired.

    This is the challenge of Gutenberg, lots of great options with the editor but new challenges that are faced as these come online.

    I totally agree. It’s very early in the life cycle of Gutenberg/Block editor. And it’s – for me – very interesting to see this evolve. Issue that surface and the discussion around them. But that’s just me. Other people need things to just work and get on with their real work.

    Not only new challenges, also new ideas of new features, that weren’t even possible in the old – pardon me- Classic editor. Like your – site-wide default setting for one of the blocks. Creating a Media + Text section on your post of page wouldn’t not have been possible with a huge extension of the existing install.

    You could add this global css which will stack regardless of the setting. (The grid-template-columns: 100% !important; css rule is exactly what is used when Stack on Mobile is selected.

    @media (max-width:600px) {
      .wp-block-media-text {
         grid-template-columns: 100% !important;
      }
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Media & Text – Stack on Mobile Sitewide’ is closed to new replies.