Using Core Components and BEM CSS classes

Avatar

Avatar

Santhi_Swaroop

Avatar

Santhi_Swaroop

Santhi_Swaroop

09-10-2019

If I want to develop a site using only core components with no customized components, do I need to ask the design and css teams to develop the css classes with BEM notation same as in core components? How do the coordination between AEM teams and design teams work and what are the best practices?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Ankur_Khare

MVP

Avatar

Ankur_Khare

MVP

Ankur_Khare
MVP

10-10-2019

Hi  Santhi ,

I think what you need to do is-

1. Identify what all components you will be using from core components.

2. Create a page using these components

3. Identify the classes used there

4. Share the same with design team

Summit2018/chapters/chapter-4 at L725 · Adobe-Marketing-Cloud/Summit2018 · GitHub

Refer below chapters for better understanding-

Summit2018/chapters at L725 · Adobe-Marketing-Cloud/Summit2018 · GitHub

https://helpx.adobe.com/experience-manager/kt/sites/using/style-system-core-components-tutorial-deve...

Answers (5)

Answers (5)

Avatar

Avatar

Santhi_Swaroop

Avatar

Santhi_Swaroop

Santhi_Swaroop

11-10-2019

Thanks guys. In addition, I think the component wrapper div element plays a key role here and must be configured via style system for all components. Say if there are two different lists to be displayed o the page, the wrapper div element would be different fro two lists. Use the same core proxy component for both but with style system handling the wrapper divs.

Avatar

Avatar

ArpitVarshney

MVP

Avatar

ArpitVarshney

MVP

ArpitVarshney
MVP

09-10-2019

Hi Santhi

Core Component has been created using adobe's best practices and recommended by Adobe for component development as a reference.

  • For core component, Adobe uses BEM methodology which is highly useful, powerful, and simple naming convention that makes your front-end code easier to read and understand, easier to work with, easier to scale, more robust and explicit, and a lot more strict.
  • Component development best practices outline that CSS rules should target BEM (Block Element Modifier) CSS class names, and these BEM CSS classes are considered the stable HTML API of the component.

It will be good if you follow the same approach.

Reference: Getting Started with Core Components and the AEM Style System - Part 6 - Applying the Teaser Compone...

Regards,

Arpit Varshney

Avatar

Avatar

Nirmal_Jose

MVP

Avatar

Nirmal_Jose

MVP

Nirmal_Jose
MVP

09-10-2019

Below could be a great starting point.

Screenshot 2019-05-30 at 22.41.31.png

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

958

Correct Answer

820

Avatar

Arun_Patidar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

958

Correct Answer

820
Arun_Patidar
MVP

11-10-2019

You can use container components well to combine 2 or more components and apply style on both together.

Style can also be added to the container component.

We are also working with Core components heavily.

Layout mode, Experience Fragments also play a big role if you are going to rely on core components only.

Avatar

Avatar

Ankur_Khare

MVP

Avatar

Ankur_Khare

MVP

Ankur_Khare
MVP

09-10-2019

nirmaljosehere

This doesn't answer original question whether ui team need to follow BEM NOTATION?