Relative styles stop working when inside a duplicated block

I created a block that uses global styles that has relative styles within the global styles. The problem occurs when I duplicate the block, the relative styles stop working. I can see that the relatives styles are still appear, however they aren’t working.

Here is a loom screen recording of what I’m experiencing.

Thank you!

Environment info

  • WordPress version: 5.9.3
  • Gutenberg Plugin version: -
  • Cwicly Plugin version: 1.1.4
  • Cwicly Theme version: 1.0.3

Hi @mattmiller,

Thank you for taking the time to report this!

Would it be possible for you to provide more information on how you are targeting these blocks?
If you could share a screenshot of your RS rules, it would be very helpful.

The reason I’m asking is that if you’re targeting specific classes or IDs, you may need to modify them to reflect the newly added block’ classes/IDs.

Thank you in advance.

Hi @Araminta,

Thanks for your help!

That was the issue. I always seem to forget that when you duplicate blocks, the class name doesn’t stay the same. I wish they did, but I’m guessing there probably a reason they don’t.

Sorry, this definitely isn’t a bug, rather a user error.

Thanks again.


1 Like

Thank you for confirming this, @mattmiller! :slight_smile:

The reason they don’t keep their classes/IDs on duplication, is to avoid having two blocks with the same class and ID names, which avoids unnecessary conflicts and is easier to maintain.

Moving this to General.