0

Is there any way to override the standard css provided by salesforce in LWC?

I tried the way we did for aura components but it doesnot seem to affect the structure in any way.

Do we have different method of doing so?

3

LWC is enforcing the shadow DOM style scoping, so you can't currently style other Elements outside your shadow tree.

LWC specifically restricts the parent from messing with the child component's presentation via the use of Shadow DOM.

That being said, there is the on-going ::part and ::theme proposal that would allow components to safely expose some of their internals outside their shadow tree to be customized. This feature will be shipped in Chrome 73 and the rest of the browser vendors are supportive. We are currently evaluating how to add this in LWC and in the lightning base components.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.