It took me a few seconds to get what you meant @Louis, and as soon as it clicked I realised what a great idea this is.
This gets a huge thumbs up from me - it actually elegantly solves the “Provide a curated set of classes that can be applied to a specific block” feature request that I made a long time ago!
The current feature to specify styles that only apply to certain tags that have specific classes applied to them is great.
We use this to for example style secondary or alternate buttons by adding a virtual class to buttons (e.g. secondary
) and adding overrides or additional properties to that. We then specify this as a class for the Global style in addition to the cc-btn class. This works really well.
With your proposal, it will then be extremely easy for clients and editors to select and apply these additional classes.
Another example where this will work amazingly well is styling alternate heading or paragraph styles.
Effectively this becomes a more unified and consistent version of the typography presets, because it works the same for developers and editors.
The only possible enhancement I can see is to add the ability within components to be able to dynamically toggle these additional classes for specific blocks from different component styles / style variations.