@atlaskit/tokens
Version:
Design tokens are the single source of truth to name and store design decisions.
15 lines • 754 B
JavaScript
import { getCustomThemeStyles } from './get-custom-theme-styles';
import { limitSizeOfCustomStyleElements } from './utils/limit-size-of-custom-style-elements';
export var CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD = 10;
export function loadAndAppendCustomThemeCss(themeState) {
var themes = getCustomThemeStyles(themeState);
limitSizeOfCustomStyleElements(CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD);
themes.map(function (theme) {
var styleTag = document.createElement('style');
document.head.appendChild(styleTag);
styleTag.dataset.theme = theme.attrs['data-theme'];
styleTag.dataset.customTheme = theme.attrs['data-custom-theme'];
styleTag.textContent = theme.css;
});
}
export { getCustomThemeStyles } from './get-custom-theme-styles';