在样式系统中,当类名是后退类名的一部分时,不呈现类名

描述 description

环境

Experience Manager

问题/症状

当类名是后退类名的一部分时,不呈现类名。 例如,将以下样式添加到文本组件策略:

Group name = Group

Styles can be combined = check on Styles Style1 = cmp-text__class1 Style2 = class1

则呈现的HTML不包含class1。

<div class="text cmp-text__class1 aem-GridColumn aem-GridColumn--default--12"> ... </div>

For Style2 = class2, the rendered HTML contains class2.

解决方法 resolution

从AEM 6.4开始,当前逻辑检查类名是否是前面的类名的一部分。 使用类似BEM的类名约定,以便每个类名都是唯一的。

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f