File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,24 @@ export type IgcChatOptions = {
127127 stopTypingDelay ?: number ;
128128
129129 /**
130- * If `true`, the component will attempt to adopt styles from the host element's document root.
130+ * A boolean flag that, when `true`, enables a **quick and dirty workaround** for styling
131+ * components rendered within the Shadow DOM, from custom message renderers, by allowing them
132+ * to inherit styles from the document's root. This can be useful for developers who prefer not to handle
133+ * Shadow DOM encapsulation, but it is **not the recommended approach**.
134+ *
135+ * It is highly advised to use standard Web Component styling methods first, in this order:
136+ *
137+ * 1. **CSS Variables and Parts API**: Use the exposed `::part` API with custom CSS variables to style
138+ * your content in your custom renderers.
139+ *
140+ * 2. **`link` elements**: For larger style sheets, link them directly within the Shadow DOM to maintain
141+ * encapsulation.
142+ *
143+ * 3. **Inline `<style>` tags**: Use these for small, self-contained styles within a template.
144+ *
145+ * This property should be used as a **last resort** as it can lead to **style leakage**, where
146+ * global styles unexpectedly bleed into the component, breaking encapsulation and causing
147+ * unpredictable visual issues.
131148 */
132149 adoptRootStyles ?: boolean ;
133150
You can’t perform that action at this time.
0 commit comments