This is a consultation about applying custom CSS when authoring with AEM.
The core component is designed so that you can only change the ID and cannot add classes. In terms of html validation, I don't think you can use the ID of each component when there are multiple identical components. However, in this case, the ID name will be unique and the same style will be written in CSS.
Request the addition of the Class property in the core component dialog.
Template authors not only need the ability to configure how components function for the content authors, but also to configure several alternative visual variations of a component.
Likewise, content authors not only need the ability to structure and arrange their content, but also to select how it is presented visually.
The Style System provides a unified solution to both the template author’s and content author’s requirements:
Template authors can define style classes in the content policy of components.
Content authors can then select these classes from a drop-down when editing the component on a page to apply the corresponding styles.
I'd rather give less control to authors... because applying CSS Styles for updating behavior is not a great practice; this can also confuse them too. You should first of all, consider the AEM Style System, and if that does not work for you... then a drop down box with styling options (granite UI) should be considered.
@岩男卓55895320 Thanks for proposing this idea. This has been reported to the engineering under the internal reference SITES-29244. The product team will triage this request to verify feasibility based on the prioritization model. This post will be updated according to Jira's status.