+ Start a Discussion
Jhon smit 10Jhon smit 10 

External css is not working in my lightning web component

Hii,
I have have demo lwc component named as DemoLwc
and i have create a new css file in that component called main.css.
But the problem is that it is not working.
can anyone help me how i will use my css file file in that component.
Best Answer chosen by Jhon smit 10
CharuDuttCharuDutt
Hii Jhon
Rename Your Css File With the Word like In Line Written Below
For Example
JS
export default class Tile extends LightningElement

Copy The Word Like in My JS the Word Is Tile 
And Rename Your Css File In Small Caps like My File Is  tile.css
Please Mark it As best Answer if it Helps
Thank You!
 

All Answers

CharuDuttCharuDutt
Hii Jhon
Rename Your Css File With the Word like In Line Written Below
For Example
JS
export default class Tile extends LightningElement

Copy The Word Like in My JS the Word Is Tile 
And Rename Your Css File In Small Caps like My File Is  tile.css
Please Mark it As best Answer if it Helps
Thank You!
 
This was selected as the best answer
Malika Pathak 9Malika Pathak 9
Hii Jhon,
You have to use the filename as yourComponentName.css
For example, your component name is TestComponent, your CSS file name must be TestComponent.css then it will be working.

if you having a problem then Ask me 
Please mark Best Answer If Your Problem Is Solved
thanks, Regards,
Malika Pathak