Closed ashish-garg07 closed 4 years ago
Hi @ashish-garg07 this seems like question related to the framework, not the sample app itself.
Basically, lwc prevents reaching into the DOM of the component from the outside (as you've encountered).
If you need a base component's functionality, but want to modify something about its internal implementation, I'd recommend looking into the OSS repo for base components. They are not all represented, but many of them are, and you might be able to get to what you need more easily than reimplementing from scratch.
Hi @pchittum There is one more workaround I found and it's working that, We can use CSS file in static resource and write down CSS which will apply on internal dom of LWC basic component. I don't know its a best practice or not, but I hope that info will be useful.
Please be aware @ashish-garg07 that the internal DOM structure of a base component can change anytime.
@muenzpraeger So whenever the DOM Structure is going to change, there will be pre-notification for that?
No, as the internals of a base component are an implementation detail. At some point in the future you may be able to customize the CSS of a base component using CSS variables, but that's somewhat out.
Yes as I know Salesforce is working on it to apply CSS on base component externally. So the developer can change the look and feel of the base component. But when they are going to release don't have information for that.
Summary
If we want to change in any look and feel of any Base Lightning Web Component then we can't make changes using CSS.
Steps To Reproduce:
Expected result
Text value within input should be align-right side.
Actual result
There is no change in look and feel.
Additional information
We can apply the outer part of LWC using CSS but if you want to change in look and feel of internal DOM then you can't do it.