@atlaskit/app-provider
Version:
A top level provider for the Design System.
15 lines • 476 B
JavaScript
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) {
const doc = getDocument();
if (!doc) {
return false;
}
return doc.head.querySelector(`style[${THEME_DATA_ATTRIBUTE}="${themeId}"]`);
}