adoptStyleSheets method

void adoptStyleSheets(
  1. List<String> cssTexts
)

Applies CSS strings as adopted stylesheets to this component's shadow root.

Uses the modern adoptedStyleSheets API for efficient style management. On the server, this is a no-op.

Implementation

void adoptStyleSheets(List<String> cssTexts) {
  if (_shadowRoot == null) return;
  final sheets = cssTexts.map(createStyleSheet).toList();
  _shadowRoot!.adoptedStyleSheets = sheets;
}