UNPKG

@atlaskit/app-provider

Version:

A top level provider for the Design System.

21 lines (20 loc) 628 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isThemeMounted = isThemeMounted; var _browserApis = require("@atlaskit/browser-apis"); var _constants = require("@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. */ function isThemeMounted(themeId) { var doc = (0, _browserApis.getDocument)(); if (!doc) { return false; } return doc.head.querySelector("style[".concat(_constants.THEME_DATA_ATTRIBUTE, "=\"").concat(themeId, "\"]")); }