I have an LWC that queries data on a record. If no data is actually returned, I want the LWC to not display at all (this is on lightning pages).
I can wrap the contents of the LWC in a <template if:true={condition}></template>
. This works for not displaying the contents, but it still renders the component and leaves a little space where the component is on the lightning page due to a margin applied to the wrapper Salesforce wraps the LWC up in.
I don't want this margin there. I want it completely hidden. How can this be achieved? I haven't been able to really find anything to help here, just information on conditional rendering of stuff inside components.
Here is what salesforce wraps LWCs in, the div with flixpageComponent class