@sitecore/sc-contenthub-blok
Version:
A UI library for [Sitecore Content Hub](https://doc.sitecore.com/ch/).
62 lines • 4.91 kB
JavaScript
import { blackAlpha } from "./colors";
import { semanticTokens } from "./semanticTokens";
import { getStyle, normalizeColor, normalizeFontNames } from "./utils";
export const fontFamilyH1 = normalizeFontNames(getStyle("--font-family-h1")) ||
"'-apple-system', 'system-ui', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', 'sans-serif'";
export const fontWeightH1 = getStyle("--font-weight-h1") || 600;
export const fontStyleH1 = getStyle("--font-style-h1") || "normal";
export const textCaseH1 = getStyle("--text-case-h1") || "none";
export const fontColorH1 = normalizeColor(getStyle("--font-color-h1") || "rgba(0, 0, 0, 0.87)");
export const fontSizeH1 = getStyle("--font-size-h1") || "2.8rem ";
// H2
export const fontFamilyH2 = normalizeFontNames(getStyle("--font-family-h2")) ||
"'-apple-system', 'system-ui', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', 'sans-serif'";
export const fontWeightH2 = getStyle("--font-weight-h2") || 600;
export const fontStyleH2 = getStyle("--font-style-h2") || "normal";
export const textCaseH2 = getStyle("--text-case-h2") || "none";
export const fontColorH2 = normalizeColor(getStyle("--font-color-h2") || "rgba(0, 0, 0, 0.87)");
export const fontSizeH2 = getStyle("--font-size-h2") || "2rem";
// H3
export const fontFamilyH3 = normalizeFontNames(getStyle("--font-family-h3")) ||
"'-apple-system', 'system-ui', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', 'sans-serif'";
export const fontWeightH3 = getStyle("--font-weight-h3") || 600;
export const fontStyleH3 = getStyle("--font-style-h3") || "normal";
export const textCaseH3 = getStyle("--text-case-h3") || "none";
export const fontColorH3 = normalizeColor(getStyle("--font-color-h3") || "rgba(0, 0, 0, 0.87)");
export const fontSizeH3 = getStyle("--font-size-h3") || "1rem";
// H4
export const fontFamilyH4 = normalizeFontNames(getStyle("--font-family-h4")) ||
"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif";
export const fontWeightH4 = getStyle("--font-weight-h4") || 600;
export const fontStyleH4 = getStyle("--font-style-h4") || "normal";
export const textCaseH4 = getStyle("--text-case-h4") || "none";
export const fontColorH4 = normalizeColor(getStyle("--font-color-h4") || "rgba(0, 0, 0, 0.87)");
export const fontSizeH4 = getStyle("--font-size-h4") || "0.875rem";
// H5
export const fontFamilyH5 = normalizeFontNames(getStyle("--font-family-h5")) ||
"'-apple-system', 'system-ui', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', 'sans-serif'";
export const fontWeightH5 = getStyle("--font-weight-h5") || 600;
export const fontStyleH5 = getStyle("--font-style-h5") || "normal";
export const textCaseH5 = getStyle("--text-case-h5") || "none";
export const fontColorH5 = normalizeColor(getStyle("--font-color-h5") || semanticTokens.subtleText.default);
export const fontSizeH5 = getStyle("--font-size-h5") || "0.8125rem";
// Base font family
export const fontFamilyBase = normalizeFontNames(getStyle("--font-family-base")) ||
"'-apple-system', 'system-ui', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', 'sans-serif'";
export const fontFamilyMono = 'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace';
// Page header
export const pageHeaderBg = normalizeColor(getStyle("--page-header-bg") || "white");
export const pageHeaderColor = normalizeColor(getStyle("--page-header-color") || blackAlpha["900"]);
export const pageHeaderFont = normalizeFontNames(getStyle("--page-header-font")) ||
"'-apple-system', 'system-ui', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', 'sans-serif'";
export const pageHeaderFontWeight = getStyle("--page-header-font-weight") || 600;
export const pageHeaderTextTransform = getStyle("--page-header-text-transform") || "none";
export const pageHeaderDarkMode = getStyle("--page-header-dark-mode") === "true";
export const pageHeaderHeight = "3.45rem";
export const pageHeaderFontSize = getStyle("--page-title-font-size") || "1.375rem";
// Navbar
export const navbarFontFamily = normalizeFontNames(getStyle("--navbar-font-family") ||
"'-apple-system', 'system-ui', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', 'sans-serif'");
export const navbarFontWeight = getStyle("--navbar-font-weight") || 500;
export const navbarTextTransform = getStyle("--navbar-text-transform") || "none";
//# sourceMappingURL=typography.js.map