Hi @vanitana1,
I completely agree with @estebanbustamante using the existing style plugin is the recommended and simplest approach in most cases, especially when the goal is just to apply classes via spans. It’s great that AEM allows us to configure it flexibly via rtePlugins and styles.
However, in this specific case, where user aiming to create a separate plugin named “Theme” for the following reasons:
-
We want to retain the existing style plugin for standard formatting use.
-
The UI/UX requirement is to keep "Themes" as a distinct dropdown (not mixed with styles).
-
There’s potential for future expansion (eg. toggle behaviors or script injection), so having a modular plugin is preferred.
I understand that writing a custom RTE plugin introduces some complexity, but since it's isolated and doesn't override any existing functionality, it aligns with best practices when clean separation of concerns is needed.
That means, for anyone who doesn't need a separate UI element, the style plugin definitely remains the best low-maintenance option.
Go throught htese articles in case: