Inject scoped CSS after the Assistant Shadow DOM is connected.
The Assistant renders inside Shadow DOM, so styles from the host page do not cross into it. Add
overrides only after tdAssistantConnected fires.
document.addEventListener('tdAssistantConnected', (event) => {
const root = event.target.shadowRoot;
if (!root) return;
const styles = document.createElement('style');
styles.textContent = `
.td-launcher {
right: 100px !important;
bottom: 50px !important;
}
.td-assistant {
right: 100px !important;
bottom: 130px !important;
}
`;
root.appendChild(styles);
});| Selector | Area |
|---|---|
.td-assistant | Main Assistant window |
.td-header | Header |
.td-body | Main content |
.td-footer | Footer navigation |
.td-card | Home-screen cards |
.td-launcher | Launcher container |
.td-launcher__icon | Launcher icon |
.td-launcher__text | Launcher text |
.td-livechat | Live Chat |
.td-contact | Contact form |
.td-order | Order Status |
.td-kb | Knowledge Base |
Upgrade stability
These class names are implementation hooks, not a versioned theme API. An Assistant release can rename or restructure them. Keep overrides small and test them after widget updates.