import { getMode } from './mode';
// These version numbers are automatically updated when releasing new versions.
// see `../../scripts/prepare.mjs`
const stencilaThemeVersion = '0.27.1';
const materialThemeVersion = '0.16.1';
// Inject theme CSS variables depending on the `mode` attribute
export const injectThemeVariables = () => {
  const mode = getMode(document.documentElement);
  const themeName = mode === 'material' ? 'material' : 'stencila';
  const themeVersion = mode === 'material' ? materialThemeVersion : stencilaThemeVersion;
  const themeVariables = document.createElement('link');
  themeVariables.rel = 'stylesheet';
  themeVariables.href = `https://unpkg.com/@stencila/style-${themeName}@${themeVersion !== null && themeVersion !== void 0 ? themeVersion : 'latest'}/dist/variables.css`;
  document.head.prepend(themeVariables);
};
//# sourceMappingURL=variables.js.map