In this blog post we will see "How to share CSS style sheet in Lightning Web Component".
1) If we want to share CSS style than we will need to create a module that contains only a CSS file.
2) After we create a module we can import the module into CSS file of any Lightning Web Component as shown below.
@import 'namespace/nameOfModule';
3) To create a module we will need to create a Lightning Web Component with only single CSS file as shown below.
cssLibrarySample.css
p{
background-color:yellow;
font-size: x-large;
}
No comments:
Post a Comment