UNPKG

@atlaskit/app-provider

Version:

A top level provider for the Design System.

15 lines 496 B
import { getDocument } from '@atlaskit/browser-apis'; import { THEME_DATA_ATTRIBUTE } from '@atlaskit/tokens/constants'; /** * Checks if a theme is mounted in the document head. * * Eventually this won't be necessary as we'll utilise AppProvider context * to track theme loading. */ export function isThemeMounted(themeId) { var doc = getDocument(); if (!doc) { return false; } return doc.head.querySelector("style[".concat(THEME_DATA_ATTRIBUTE, "=\"").concat(themeId, "\"]")); }