Generate Unique IDs or Classes on Gutenberg Components #12067
Labels
[Feature] Extensibility
The ability to extend blocks or the editing experience
[Type] Enhancement
A suggestion for improvement.
Is your feature request related to a problem? Please describe.
I see this was requested before in #6507, but I think it may be worth reconsidering. I'd ask that Components each get a unique ID to allow for more targeted styling, JS, etc. If I understand it right, it seems this is also causing issues in e2e testing (#7974).
The original ticket was closed for the following reason:
However, at the moment, the various ways to disable features seem to be lacking, so this is out only option. Right now, I'm updating a plugin that will be hiding the dropcap option. Since there's no way to programmatically do that and there isn't a unique ID or class, I'm going with a I-hope-this-doesn't-hide-anything-else approach:
Describe the solution you'd like
More unique IDs and classes to enable e2e tests and give developers the hooks they need for functions not provided by an API. It's neither possible nor desirable to make an API to do every possible thing a developer might want, so this feels like a very reasonable solution.
Describe alternatives you've considered
As best I can tell, there is no alternative for what I'm trying to do. In many cases (like styling a component), there is no alternative other than selectors that will be prone to breaking or selecting more than intended. Even if this may encourage some less-than-ideal behavior, the alternative feels worse.
The text was updated successfully, but these errors were encountered: