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

    Function getDocumentTheme

    • Get the current document theme from the root HTML element.

      Reads the theme from the data-theme attribute on document.documentElement. Falls back to checking for a dark class for compatibility with Tailwind CSS dark mode conventions.

      Returns McpUiTheme

      The current theme ("light" or "dark")

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

      const theme = getDocumentTheme();
      console.log(`Current theme: ${theme}`);