gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Additional css classes should be applied to transformed blocks

Open richtabor opened this issue 5 years ago • 4 comments

What problem does this address?

When transforming blocks between each other, classes added through the Advanced Additional CSS field are not carried with the transform. Is there a clear reason behind this? Related to transforms explorations in #34591 and #34590.

What is your proposed solution?

I’d expect that if I’ve added a class myself, that class would be persistent when transforming a block.

Screenshot

Screen Shot 2021-09-06 at 11 27 00 AM

richtabor avatar Sep 06 '21 15:09 richtabor

Is there any way of detecting whether a class has been added by the user, versus a class added by selecting a block style?

What I'm getting at is a block style and its CSS class will often be specific to that block, and keeping the class when transforming a block could possibly lead to confusion?

Sandstromer avatar Sep 06 '21 15:09 Sandstromer

Is there any way of detecting whether a class has been added by the user, versus a class added by selecting a block style?

Not 100% sure myself, but we could omit .is-style-... from being carried over.

richtabor avatar Sep 06 '21 15:09 richtabor

I think the issue was fixed via #38964.

Mamaduka avatar May 25 '22 16:05 Mamaduka

Yup, just confirmed it. Thanks George!

richtabor avatar May 25 '22 18:05 richtabor