how the js and css files are mapped to a component from ui.frontend? | Adobe Higher Education
Skip to main content
Ce sujet a été fermé aux réponses.
Meilleure réponse par MRashidRaza

There is no mapping is required. Using ClientLibs categories adding the JS and CSS under /apps/<project>/cleintlibs. And then while writing the css use a parent class name like cmp-<component_name> that work as prefix with all css and JS(ref screenshot 1 below). 

Then in component html use the same prefix classname with all your classes. Like below screenshot 2.

screenshot 1:

 

screenshot 2:

 

 

2 commentaires

Saravanan_Dharmaraj
Community Advisor
Community Advisor
May 9, 2023
Keerthi0555
Level 5
May 10, 2023

Hi Sravanan,

 

I went through the documentation it's there about adding clientlibs to the template but for a specific component how to add css / js from ui.frontend.

 

Is it based on the name of the css and js files with component's name?

MRashidRazaAdobe EmployeeRéponse
Adobe Employee
May 10, 2023

There is no mapping is required. Using ClientLibs categories adding the JS and CSS under /apps/<project>/cleintlibs. And then while writing the css use a parent class name like cmp-<component_name> that work as prefix with all css and JS(ref screenshot 1 below). 

Then in component html use the same prefix classname with all your classes. Like below screenshot 2.

screenshot 1:

 

screenshot 2:

 

 

Keerthi0555
Level 5
May 10, 2023

no from ui.frontend not from ui.apps.

Adobe Employee
May 10, 2023

I answered from ui.frontend only. Read carefully and browse the project.