AyeCode / blockstrap-page-builder-blocks

0 stars 2 forks source link

Shape divider: classname also duplicated #47

Open RachidBray opened 1 year ago

RachidBray commented 1 year ago

Hi, When you duplicate a shape divider block (both block get the same classname) The problem is that whenever you change a setting in one block all blocks are affected.

image

We can avoid this by adding a block everytime we need it but i don't think it's sustainable.

Stiofan commented 1 year ago

This is a pain, i tried a few of the wp.hooks but I could not get them working, we need to add a check for this when we can find a working example of the duplicate action hook.

RachidBray commented 1 year ago

What about adding utility classes instead of generating CSS rules ?

Example:

Styles

sd-position-top {
    transform: scaleX(-1);
}

sd-position-bottom {
   transform: scaleX(-1) rotate(180deg);
}

HTML Markup <div class="wp-block-blockstrap-blockstrap-widget-shape-divider block-1b23ghy7jtl blockstrap-shape blockstrap-shape-top position-absolute sd-position-top">

RachidBray commented 1 year ago

I just noticed that the block already generates a class for position blockstrap-shape-top, but the css rule is missing.