Thanks to visit codestin.com
Credit goes to modelcontextprotocol.github.io

@modelcontextprotocol/ext-apps - v0.2.2
    Preparing search index...

    Function applyDocumentTheme

    • Apply a theme to the document root element.

      Sets the data-theme attribute and CSS color-scheme property on document.documentElement. This enables CSS selectors like [data-theme="dark"] and ensures native elements (scrollbars, form controls) respect the theme.

      Parameters

      • theme: McpUiTheme

        The theme to apply ("light" or "dark")

      Returns void

      import { applyDocumentTheme } from '@modelcontextprotocol/ext-apps';

      app.onhostcontextchanged = (params) => {
      if (params.theme) {
      applyDocumentTheme(params.theme);
      }
      };
      [data-theme="dark"] {
      --bg-color: #1a1a1a;
      }
      [data-theme="light"] {
      --bg-color: #ffffff;
      }