How to Style Components in AEM, css is not getting compiled - AEM version 6.5 | Community
Skip to main content
Level 3
Apr 19, 2021 12:28 PM UTC
Solved

How to Style Components in AEM, css is not getting compiled - AEM version 6.5

Hi All,

 

I have created Maven Project, When I try to add styles to the components I was not able to see the styles on the components, css is not even getting compiled. 

 

Please Advise what is the correct structure to follow for ClientLib in AEM and how to apply these clientLib/styles to the components. 

 

 

 

Thanks

Heena

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Apr 19, 2021 12:36 PM UTC

Hi @heena91 

 

Please see the structure below:

 

This is how the index.less will look like:

@import 'variables/index.less';
@import 'mixins/index.less';

@import 'base/index.less';
@import 'structure/index.less';
@import 'vendor/bootstrap.less';
@import 'components/index.less';

 

css.txt will have the index entry only.

#base=styles
index.less

 We need to ensure the clientlib category is loading on the page.

 

Thanks!

3 replies

Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Apr 19, 2021 12:36 PM UTC

Hi @heena91 

 

Please see the structure below:

 

This is how the index.less will look like:

@import 'variables/index.less';
@import 'mixins/index.less';

@import 'base/index.less';
@import 'structure/index.less';
@import 'vendor/bootstrap.less';
@import 'components/index.less';

 

css.txt will have the index entry only.

#base=styles
index.less

 We need to ensure the clientlib category is loading on the page.

 

Thanks!

Translate
Heena91Author
Level 3
Apr 19, 2021 12:51 PM UTC

Hi @asutosh_jena_

 

Thanks for the response.

 

Could you please help below quesries:

 

1. How to ensure the clientlib category is loading on the page?

2. How to connect/apply clientlib with the component? (just by calling the class name mentioned in less from HTML page or anything else is also required)

 

 

Thanks

Heena

Translate