UNPKG

@aegisjsproject/styles

Version:

Pre-made and reusable styles for `@aegisjsproject/core`

2,143 lines (1,732 loc) 48.9 kB
'use strict'; /** * Bootstrap Colors mapped to JS arrays. * `export const red[100` maps to `red[0]` and `export const red[900` maps to `red[9]` * or generally `(### / 100) - 1`. */ const red$1 = [ '#f8d7da', '#f1aeb5', '#ea868f', '#e35d6a', '#dc3545', '#b02a37', '#842029', '#58151c', '#2c0b0e', ]; const blue$1 = [ '#cfe2ff', '#9ec5fe', '#6ea8fe', '#3d8bfd', '#0d6efd', '#0a58ca', '#084298', '#052c65', '#031633', ]; const indigo = [ '#e0cffc', '#c29ffa', '#a370f7', '#8540f5', '#6610f2', '#520dc2', '#3d0a91', '#290661', '#140330', ]; const purple$1 = [ '#e2d9f3', '#c5b3e6', '#a98eda', '#8c68cd', '#6f42c1', '#59359a', '#432874', '#2c1a4d', '#160d27', ]; const pink = [ '#f7d6e6', '#efadce', '#e685b5', '#de5c9d', '#d63384', '#ab296a', '#801f4f', '#561435', '#2b0a1a', ]; const orange$1 = [ '#ffe5d0', '#fecba1', '#feb272', '#fd9843', '#fd7e14', '#ca6510', '#984c0c', '#653208', '#331904' ]; const yellow$1 = [ '#fff3cd', '#ffe69c', '#ffda6a', '#ffcd39', '#ffc107', '#cc9a06', '#997404', '#664d03', '#332701', ]; const green$1 = [ '#d1e7dd', '#a3cfbb', '#75b798', '#479f76', '#198754', '#146c43', '#0f5132', '#0a3622', '#051b11', ]; const teal = [ '#d2f4ea', '#a6e9d5', '#79dfc1', '#4dd4ac', '#20c997', '#1aa179', '#13795b', '#0d503c', '#06281e', ]; const cyan = [ '#cff4fc', '#9eeaf9', '#6edff6', '#3dd5f3', '#0dcaf0', '#0aa2c0', '#087990', '#055160', '#032830', ]; const gray = [ '#f8f9fa', '#e9ecef', '#dee2e6', '#ced4da', '#adb5bd', '#6c757d', '#495057', '#343a40', '#212529', ]; const light$2 = gray[0]; const grayDark = gray[7]; const dark$2 = gray[8]; const primary$1 = blue$1[4]; const secondary$1 = gray[5]; const success$1 = green$1[4]; const info$1 = cyan[4]; const warning$1 = yellow$1[4]; const danger$1 = red$1[4]; var bootstrap = /*#__PURE__*/Object.freeze({ __proto__: null, blue: blue$1, cyan: cyan, danger: danger$1, dark: dark$2, gray: gray, grayDark: grayDark, green: green$1, indigo: indigo, info: info$1, light: light$2, orange: orange$1, pink: pink, primary: primary$1, purple: purple$1, red: red$1, secondary: secondary$1, success: success$1, teal: teal, warning: warning$1, yellow: yellow$1 }); const blue = ['#99c1f1', '#62a0ea', '#3584e4', '#1c71d8', '#1a5fb4']; const green = ['#8ff0a4', '#57e389', '#33d17a', '#2ec27e', '#26a269']; const yellow = ['#f9f06b', '#f8e45c', '#f6d32d', '#f5c211', '#e5a50a']; const orange = ['#ffbe6f', '#ffa348', '#ff7800', '#e66100', '#c64600']; const red = ['#f66151', '#ed333b', '#e01b24', '#c01c28', '#a51d2d']; const purple = ['#dc8add', '#c061cb', '#9141ac', '#813d9c', '#613583']; const brown = ['#cdab8f', '#b5835a', '#986a44', '#865e3c', '#63452c']; const light$1 = ['#ffffff', '#f6f5f4', '#deddda', '#c0bfbc', '#9a9996']; const dark$1 = ['#77767b', '#5e5c64', '#3d3846', '#241f31', '#000000']; var gnome = /*#__PURE__*/Object.freeze({ __proto__: null, blue: blue, brown: brown, dark: dark$1, green: green, light: light$1, orange: orange, purple: purple, red: red, yellow: yellow }); const colorLight = dark$2; const colorDark = light$2; const bgLight = light$2; const bgDark = dark$2; const borderLight = gray[2]; const borderDark = gray[6]; const btnPrimary = primary$1; const btnPrimaryActive = blue$1[6]; const btnPrimaryHover = blue$1[5]; const btnSecondary = secondary$1; const btnSecondaryActive = gray[7]; const btnSecondaryHover = gray[6]; const btnDisabled = gray[5]; const btnSuccess = success$1; const btnSuccessActive = green$1[6]; const btnSuccessHover = green$1[5]; const btnInfo = info$1; const btnInfoActive = cyan[5]; const btnInfoHover = cyan[6]; const btnWarning = warning$1; const btnWarningActive = yellow$1[6]; const btnWarningHover = yellow$1[5]; const btnDanger = danger$1; const btnDangerActive = red$1[6]; const btnDangerHover = red$1[5]; const btnLight = light$2; const btnLightActive = gray[2]; const btnLightHover = gray[1]; const btnDark = dark$2; const btnDarkActive = gray[7]; const btnDarkHover = gray[6]; const btnLink = 'transparent'; // Link button background should be transparent const btnLinkHover = 'transparent'; const btnLinkActive = 'transparent'; const linkColor = 'LinkText'; const scrollbarColor = primary$1; const scrollbarTrack = gray[8]; var aegis = /*#__PURE__*/Object.freeze({ __proto__: null, bgDark: bgDark, bgLight: bgLight, borderDark: borderDark, borderLight: borderLight, btnDanger: btnDanger, btnDangerActive: btnDangerActive, btnDangerHover: btnDangerHover, btnDark: btnDark, btnDarkActive: btnDarkActive, btnDarkHover: btnDarkHover, btnDisabled: btnDisabled, btnInfo: btnInfo, btnInfoActive: btnInfoActive, btnInfoHover: btnInfoHover, btnLight: btnLight, btnLightActive: btnLightActive, btnLightHover: btnLightHover, btnLink: btnLink, btnLinkActive: btnLinkActive, btnLinkHover: btnLinkHover, btnPrimary: btnPrimary, btnPrimaryActive: btnPrimaryActive, btnPrimaryHover: btnPrimaryHover, btnSecondary: btnSecondary, btnSecondaryActive: btnSecondaryActive, btnSecondaryHover: btnSecondaryHover, btnSuccess: btnSuccess, btnSuccessActive: btnSuccessActive, btnSuccessHover: btnSuccessHover, btnWarning: btnWarning, btnWarningActive: btnWarningActive, btnWarningHover: btnWarningHover, colorDark: colorDark, colorLight: colorLight, linkColor: linkColor, scrollbarColor: scrollbarColor, scrollbarTrack: scrollbarTrack }); const stringify = thing => { switch(typeof thing) { case 'undefined': return ''; case 'boolean': return thing ? 'true' : 'false'; case 'object': if (thing === null) { return ''; } else if (thing instanceof CSSStyleSheet) { return [...thing.cssRules].map(rule => rule.cssText).join('\n\n'); } else if (thing instanceof CSSRule) { return thing.cssText; } else if (thing instanceof HTMLLinkElement) { return stringify(thing.sheet); } else if (thing instanceof ArrayBuffer && Uint8Array.prototype.toBase64 instanceof Function) { return new Uint8Array(thing).toBase64(); } else if (ArrayBuffer.isView(thing) && thing.toBase64 instanceof Function) { return thing.toBase64(); } else if (thing instanceof Blob) { return URL.createObjectURL(thing); } else { return thing.toString(); } default: return thing.toString(); } }; function createStyleSheet(cssRules, { media, disabled, baseURL } = {}) { const sheet = new CSSStyleSheet({ media: media instanceof MediaQueryList ? media.media : media, disabled, baseURL }); sheet.replace(cssRules).catch(reportError); return sheet; } function createStyleSheetSync(cssRules, { media, disabled, baseURL } = {}) { const sheet = new CSSStyleSheet({ media: media instanceof MediaQueryList ? media.media : media, disabled, baseURL }); sheet.replaceSync(cssRules); return sheet; } const createCSSParser = ({ media, disabled, baseURL, sync = false } = {}) => sync ? (strings, ...args) => createStyleSheetSync(String.raw(strings, ...args.map(stringify)).trim(), { media, disabled, baseURL }) : (strings, ...args) => createStyleSheet(String.raw(strings, ...args.map(stringify)).trim(), { media, disabled, baseURL }); const css = createCSSParser(); const reset = css`body { margin: 0; } *, ::before, *::after { box-sizing: border-box; }`; const customProperties = { 'font': { initialValue: 'system-ui', syntax: '<custom-ident> | <string>' }, 'btn-border-radius': { initialValue: '5px', syntax: '<length>' }, 'btn-border-width': { initialValue: '0px', syntax: '<length>' }, 'color-light': { initialValue: colorLight, syntax: '<color>' }, 'color-dark': { initialValue: colorDark, syntax: '<color>' }, 'bg-light': { initialValue: bgLight, syntax: '<color>' }, 'bg-dark': { initialValue: bgDark, syntax: '<color>' }, 'border-color-light': { initialValue: borderLight, syntax: '<color>' }, 'border-color-dark': { initialValue: borderDark, syntax: '<color>' }, 'border-radius': { initialValue: '8px', syntax: '<length>' }, 'btn-primary': { initialValue: btnPrimary, syntax: '<color>' }, 'btn-primary-hover': { initialValue: btnPrimaryHover, syntax: '<color>' }, 'btn-primary-active': { initialValue: btnPrimaryActive, syntax: '<color>' }, 'btn-primary-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'btn-secondary': { initialValue: btnSecondary, syntax: '<color>' }, 'btn-secondary-hover': { initialValue: btnSecondaryHover, syntax: '<color>' }, 'btn-secondary-active': { initialValue: btnSecondaryActive, syntax: '<color>' }, 'btn-success': { initialValue: btnSuccess, syntax: '<color>' }, 'btn-success-hover': { initialValue: btnSuccessHover, syntax: '<color>' }, 'btn-success-active': { initialValue: btnSuccessActive, syntax: '<color>' }, 'btn-success-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'btn-info': { initialValue: btnInfo, syntax: '<color>' }, 'btn-info-hover': { initialValue: btnInfoHover, syntax: '<color>' }, 'btn-info-active': { initialValue: btnInfoActive, syntax: '<color>' }, 'btn-info-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'btn-warning': { initialValue: btnWarning, syntax: '<color>' }, 'btn-warning-hover': { initialValue: btnWarningHover, syntax: '<color>' }, 'btn-warning-active': { initialValue: btnWarningActive, syntax: '<color>' }, 'btn-warning-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'btn-danger': { initialValue: btnDanger, syntax: '<color>' }, 'btn-danger-hover': { initialValue: btnDangerHover, syntax: '<color>' }, 'btn-danger-active': { initialValue: btnDangerActive, syntax: '<color>' }, 'btn-danger-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'btn-dark': { initialValue: btnDark, syntax: '<color>' }, 'btn-dark-hover': { initialValue: btnDarkHover, syntax: '<color>' }, 'btn-dark-active': { initialValue: btnDarkActive, syntax: '<color>' }, 'btn-dark-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'btn-light': { initialValue: btnLight, syntax: '<color>' }, 'btn-light-hover': { initialValue: btnLightHover, syntax: '<color>' }, 'btn-light-active': { initialValue: btnLightActive, syntax: '<color>' }, 'btn-light-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'btn-link': { initialValue: btnLink, syntax: '<color>' }, 'btn-link-hover': { initialValue: btnLinkHover, syntax: '<color>' }, 'btn-link-active': { initialValue: btnLinkActive, syntax: '<color>' }, 'btn-link-disabled': { initialValue: btnDisabled, syntax: '<color>' }, 'link-color': { initialValue: linkColor, syntax: '<color>' }, 'scrollbar-color': { initialValue: scrollbarColor, syntax: '<color>' }, 'scrollbar-track': { initialValue: scrollbarTrack, syntax: '<color>' }, 'scrollbar-width': { initialValue: 'auto', syntax: '<custom-ident>' }, 'blink-speed': { initialValue: '200ms', syntax: '<time>' }, 'fast-speed': { initialValue: '400ms', syntax: '<time>' }, 'normal-speed': { initialValue: '600ms', syntax: '<time>' }, 'slow-speed': { initialValue: '800ms', syntax: '<time>' }, 'crawl-speed': { initialValue: '1200ms', syntax: '<time>' }, 'btn-disabled-opacity': { initialValue: 0.65, syntax: '<number>' }, 'btn-disabled-saturation': { initialValue: '50%', syntax: '<percentage>' }, 'btn-disabled-brightness': { initialValue: '90%', syntax: '<percentage>' }, }; const SUPPORTS_CUSTOM_STATES = CSS.supports('selector(:state(foo))'); const properties = css`${Object.entries(customProperties).map( ([name, { initialValue, inherits = true, syntax = '*' }]) => `@property --aegis-${name} { syntax: "${syntax}"; inherits: ${inherits}; initial-value: ${initialValue}; }` ).join('\n\n')}`; const propertiesLegacy = css`:root { ${Object.entries(customProperties).map(([name, { initialValue }]) => `--aegis-${name}: ${initialValue};\n`).join('\n')} }`; const darkCSS = createCSSParser({ media: '(prefers-color-scheme: dark)' }); const lightCSS = createCSSParser({ media: '(prefers-color-scheme: light)' }); const baseTheme = css`:root { color-scheme: light dark; color: var(--aegis-color-light, ${dark$2}); background-color: var(--aegis-bg-light, ${light$2}); font-family: var(--aegis-font, system-ui); } :root[data-theme="light"] { color-scheme: light; color: var(--aegis-color-light, ${dark$2}); background-color: var(--aegis-bg-light, ${light$2}); } :root[data-theme="dark"] { color-scheme: dark; color: var(--aegis-color-dark, ${light$2}); background-color: var(--aegis-bg-dark, ${dark$2}); }`; const darkTheme = darkCSS`:root:not([data-theme="light"]) { color: var(--aegis-color-dark, ${light$2}); background-color: var(--aegis-bg-dark, ${dark$2}); }`; const lightTheme = lightCSS`:root:not([data-theme="dark"]) { color: var(--aegis-color-light, ${dark$2}); background-color: var(--aegis-bg-light, ${light$2}); }`; const componentBase = css`:host { color-scheme: light dark; color: var(--aegis-color-light, ${dark$2}); background-color: var(--aegis-bg-light, ${light$2}); font-family: system-ui; } :host(:not([hidden]):not([popover])) { display: block; } :host-context([data-theme="light"]):host(:not([theme="dark"])) { color-scheme: light; color: var(--aegis-color-light, ${dark$2}); background-color: var(--aegis-bg-light, ${light$2}); } :host-context([data-theme="dark"]):host(:not([theme="light"])) { color-scheme: dark; color: var(--aegis-color-dark, ${light$2}); background-color: var(--aegis-bg-dark, ${dark$2}); } :host([theme="light"]) { color-scheme: light; color: var(--aegis-color-light, ${dark$2}); background-color: var(--aegis-bg-light, ${light$2}); } :host([theme="dark"]) { color-scheme: dark; color: var(--aegis-color-dark, ${light$2}); background-color: var(--aegis-bg-dark, ${dark$2}); }`; const componentBorder = css`:host { border-width: 1px; border-style: solid; border-color: var(--aegis-border-color-light, ${gray[2]}); border-radius: var(--aegis-border-radius, 8px); } :host([theme="light"]) { border-color: var(--aegis-border-color-light, ${gray[2]}); } :host([theme="dark"]) { border-color: var(--aegis-border-color-dark, ${gray[6]}); } :host-context([data-theme="light"]):host(:not([theme="dark"])) { border-color: var(--aegis-border-color-light, ${gray[2]}); } :host-context([data-theme="dark"]):host(:not([theme="light"])) { border-color: var(--aegis-border-color-dark, ${gray[6]}); } @media (prefers-color-scheme: dark) { :host(:not([theme="light"])) { border-color: var(--aegis-border-color-dark, ${gray[6]}); } }`; const componentDarkTheme = darkCSS`:host(:not([theme="light"])) { color-scheme: dark; color: var(--aegis-color-dark, ${light$2}); background-color: var(--aegis-bg-dark, ${dark$2}); }`; const componentLightTheme = lightCSS`:host(:not([theme="dark"])) { color-scheme: light; color: var(--aegis-color-light, ${light$2}); background-color: var(--aegis-bg-light, ${dark$2}); }`; const DISABLED_STATE = SUPPORTS_CUSTOM_STATES ? ':state(--disabled)' : '._state--disabled'; const DISABLED = `:disabled, .disabled, ${DISABLED_STATE}`; const btn = css`.btn:not([hidden]) { cursor: pointer; display: inline-block; padding: 0.6em 1.3em; border-width: var(--aegis-btn-border-width, 0px); border-style: solid; appearance: button; line-height: 1.5; text-align: center; vertical-align: middle; font-family: inherit; font-size: 1rem; border-radius: var(--aegis-btn-border-radius, 5px); text-decoration: none; transition: background-color 150ms ease-in-out, border-color 150ms ease-in-out, color 150ms ease-in-out; } .btn.btn-sm { padding: 0.5em 1em; font-size: 0.7rem; } .btn.btn-lg { padding: 0.5em 1.1em; font-size: 1.3rem; } .btn.btn-block { display: block; width: 100%; } .btn:disabled:not(.btn-system, .btn-system-accent), .btn.disabled:not(.btn-system, .btn-system-accent), .btn${DISABLED} { cursor: not-allowed; opacity: var(--aegis-btn-disabled-opacity, 0.65); filter: saturate(var(--aegis-btn-disabled-saturation, 50%)) brightness(var(--aegis-btn-disabled-brightness, 90%)); } .btn.disabled, .btn${DISABLED_STATE} { pointer-events: none; } .btn:focus-visible { outline: 2px solid; outline-offset: 2px; }`; const system = css`.btn.btn-system { background-color: ButtonFace; color: ButtonText; border-color: hsl(from ButtonFace h s calc(l - 0.2)); } .btn.btn-system:hover { background-color: hsl(from ButtonFace h s calc(l * 1.1)); border-color: hsl(from ButtonFace h s calc(l * 1.1)); } .btn.btn-system:focus-visible { background-color: hsl(from ButtonFace h calc(s * 1.05) calc(l * 1.05)); border-color: hsl(from ButtonFace h calc(s * 1.05) calc(l * 1.05)); outline: 2px solid ButtonText; outline-offset: 2px; } .btn.btn-system:active { background-color: hsl(from ButtonFace h s calc(l * 0.8)); border-color: hsl(from ButtonFace h s calc(l * 0.8)); } .btn.btn-system:disabled, .btn.btn-system.disabled, .btn.btn-system${DISABLED_STATE} { background-color: hsl(from ButtonFace h calc(s * 0.2) l); border-color: hsl(from ButtonFace h calc(s * 0.2) l); color: GrayText; }`; const systemAccent = css`.btn.btn-system-accent { background-color: AccentColor; color: AccentColorText; border-color: hsl(from AccentColor h s calc(l - 0.2)); } .btn.btn-system-accent:hover { background-color: hsl(from AccentColor h s calc(l * 1.1)); border-color: hsl(from AccentColor h s calc(l * 1.1)); } .btn.btn-system-accent:focus-visible { background-color: hsl(from AccentColor h calc(s * 1.05) calc(l * 1.05)); border-color: hsl(from AccentColor h calc(s * 1.05) calc(l * 1.05)); outline: 2px solid hsl(from AccentColor h s calc(l - 0.3)); outline-offset: 2px; } .btn.btn-system-accent:active { background-color: hsl(from AccentColor h s calc(l * 0.8)); border-color: hsl(from AccentColor h s calc(l * 0.8)); } .btn.btn-system-accent:disabled, .btn.btn-system-accent.disabled, .btn.btn-system${DISABLED_STATE} { background-color: hsl(from AccentColor h calc(s * 0.2) l); border-color: hsl(from AccentColor h calc(s * 0.2) l); color: GrayText; }`; const primary = css`.btn.btn-primary { background-color: var(--aegis-btn-primary, ${btnPrimary}); color: var(--aegis-color-dark, ${colorDark}); border-color: ${blue$1[6]}; } .btn.btn-primary:hover:not(${DISABLED}), .btn.btn-primary:focus-visible { background-color: var(--aegis-btn-primary-hover, ${btnPrimaryHover}); border-color: ${blue$1[7]}; } .btn.btn-primary:focus-visible { outline-color: var(--aegis-btn-primary, ${btnPrimary}); } .btn.btn-primary:active { background-color: var(--aegis-btn-primary-active, ${btnPrimaryActive}); border-color: ${blue$1[8]}; }`; const btnOutlinePrimary = css`.btn.btn-outline-primary { background-color: transparent; color: var(--aegis-btn-primary, ${btnPrimary}); border-color: currentColor; } .btn.btn-outline-primary:focus-visible { outline-color: var(--aegis-btn-primary, ${btnPrimary}); } .btn.btn-outline-primary:hover:not(${DISABLED}), .btn.btn-outline-primary:focus-visible { background-color: var(--aegis-btn-primary-hover, ${btnPrimaryHover}); border-color: ${blue$1[7]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-primary:active { background-color: var(--aegis-btn-primary-active, ${btnPrimaryActive}); border-color: ${blue$1[8]}; color: var(--aegis-color-dark, ${colorDark}); }`; const secondary = css`.btn.btn-secondary { background-color: var(--aegis-btn-secondary, ${btnSecondary}); color: var(--aegis-color-dark, ${colorDark}); border-color: ${gray[7]}; } .btn.btn-secondary:hover:not(${DISABLED}), .btn.btn-secondary:focus-visible { background-color: var(--aegis-btn-secondary-hover, ${btnSecondaryHover}); border-color: ${gray[8]}; } .btn.btn-secondary:focus-visible { outline-color: var(--aegis-btn-secondary, ${btnSecondary}); } .btn.btn-secondary:active { background-color: var(--aegis-btn-secondary-active, ${btnSecondaryActive}); border-color: ${gray[9]}; }`; const btnOutlineSecondary = css`.btn.btn-outline-secondary { background-color: transparent; color: var(--aegis-btn-secondary, ${btnSecondary}); border-color: currentColor; } .btn.btn-outline-secondary:hover:not(${DISABLED}), .btn.btn-outline-secondary:focus-visible { background-color: var(--aegis-btn-secondary-hover, ${btnSecondaryHover}); border-color: ${gray[8]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-secondary:focus-visible { outline-color: var(--aegis-btn-secondary, ${btnSecondary}); } .btn.btn-outline-secondary:active { background-color: var(--aegis-btn-secondary-active, ${btnSecondaryActive}); border-color: ${gray[9]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-secondary:disabled, .btn.btn-outline-secondary.disabled, .btn.btn-outline-seconday${DISABLED_STATE} { color: var(--aegis-btn-active-disabled, ${btnDisabled}); }`; const success = css`.btn.btn-success { background-color: var(--aegis-btn-success, ${btnSuccess}); color: var(--aegis-color-dark, ${colorDark}); border-color: ${green$1[6]}; } .btn.btn-success:hover:not(${DISABLED}), .btn.btn-success:focus-visible { background-color: var(--aegis-btn-success-hover, ${btnSuccessHover}); border-color: ${green$1[7]}; } .btn.btn-success:focus-visible { outline-color: var(--aegis-btn-success, ${btnSuccess}); } .btn.btn-success:active { background-color: var(--aegis-btn-success-active, ${btnSuccessActive}); border-color: ${green$1[8]}; }`; const btnOutlineSuccess = css`.btn.btn-outline-success { background-color: transparent; color: var(--aegis-btn-success, ${btnSuccess}); border-color: currentColor; } .btn.btn-outline-success:hover:not(${DISABLED}), .btn.btn-outline-success:focus-visible { background-color: var(--aegis-btn-success-hover, ${btnSuccessHover}); border-color: ${green$1[7]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-success:focus-visible { outline-color: var(--aegis-btn-success, ${btnSuccess}); } .btn.btn-outline-success:active { background-color: var(--aegis-btn-success-active, ${btnSuccessActive}); border-color: ${green$1[8]}; color: var(--aegis-color-dark, ${colorDark}); }`; const info = css`.btn.btn-info { background-color: var(--aegis-btn-info, ${btnInfo}); color: var(--aegis-color-dark, ${colorDark}); border-color: ${cyan[6]}; } .btn.btn-info:not(${DISABLED}), .btn.btn-info:focus-visible { background-color: var(--aegis-btn-info-hover, ${btnInfoHover}); border-color: ${cyan[7]}; } .btn.btn-info:focus-visible { outline-color: var(--aegis-btn-info, ${btnInfo}); } .btn.btn-info:active { background-color: var(--aegis-btn-info-active, ${btnInfoActive}); border-color: ${cyan[8]}; }`; const btnOutlineInfo = css`.btn.btn-outline-info { background-color: transparent; color: var(--aegis-btn-info, ${btnInfo}); border-color: currentColor; } .btn.btn-outline-info:hover:not(${DISABLED}), .btn.btn-outline-info:focus-visible { background-color: var(--aegis-btn-info-hover, ${btnInfoHover}); border-color: ${cyan[7]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-info:focus-visible { outline-color: var(--aegis-btn-info, ${btnInfo}); } .btn.btn-outline-info:active { background-color: var(--aegis-btn-info-active, ${btnInfoActive}); border-color: ${cyan[8]}; color: var(--aegis-color-dark, ${colorDark}); }`; const danger = css`.btn.btn-danger { background-color: var(--aegis-btn-danger, ${btnDanger}); color: var(--aegis-color-dark, ${colorDark}); border-color: ${red$1[6]}; } .btn.btn-danger:hover:not(${DISABLED}), .btn.btn-danger:focus-visible { background-color: var(--aegis-btn-danger-hover, ${btnDangerHover}); border-color: ${red$1[7]}; } .btn.btn-danger:focus-visible { outline-color: var(--aegis-btn-danger, ${btnDanger}); } .btn.btn-danger:active { background-color: var(--aegis-btn-danger-active, ${btnDangerActive}); border-color: ${red$1[8]}; }`; const btnOutlineDanger = css`.btn.btn-outline-danger { background-color: transparent; color: var(--aegis-btn-danger, ${btnDanger}); border-color: currentColor; } .btn.btn-outline-danger:hover:not(${DISABLED}), .btn.btn-outline-danger:focus-visible { background-color: var(--aegis-btn-danger-hover, ${btnDangerHover}); border-color: ${red$1[7]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-danger:focus-visible { outline-color: var(--aegis-btn-danger, ${btnDanger}); } .btn.btn-outline-danger:active { background-color: var(--aegis-btn-danger-active, ${btnDangerActive}); border-color: ${red$1[8]}; color: var(--aegis-color-dark, ${colorDark}); }`; const warning = css`.btn.btn-warning { background-color: var(--aegis-btn-warning, ${btnWarning}); color: var(--aegis-color-light, ${colorLight}); border-color: ${yellow$1[6]}; } .btn.btn-warning:hover:not(${DISABLED}), .btn.btn-warning:focus-visible { background-color: var(--aegis-btn-warning-hover, ${btnWarningHover}); border-color: ${yellow$1[7]}; } .btn.btn-warning:focus-visible { outline-color: var(--aegis-btn-warning, ${btnWarning}); } .btn.btn-warning:active { background-color: var(--aegis-btn-warning-active, ${btnWarningActive}); border-color: ${yellow$1[8]}; }`; const btnOutlineWarning = css`.btn.btn-outline-warning { background-color: transparent; color: var(--aegis-btn-warning, ${btnWarning}); border-color: currentColor; } .btn.btn-outline-warning:not(${DISABLED}), .btn.btn-outline-warning:focus-visible { background-color: var(--aegis-btn-warning-hover, ${btnWarningHover}); border-color: ${yellow$1[7]}; color: var(--aegis-color-light, ${colorLight}); } .btn.btn-outline-warning:active { background-color: var(--aegis-btn-warning-active, ${btnWarningActive}); border-color: ${yellow$1[8]}; color: var(--aegis-color-light, ${colorLight}); } .btn.btn-outline-warning:focus-visible { outline-color: var(--aegis-btn-warning, ${btnWarning}); }`; const light = css`.btn.btn-light { background-color: var(--aegis-btn-light, ${btnLight}); color: var(--aegis-color-light, ${colorLight}); border-color: ${gray[2]}; } .btn.btn-light:hover:not(${DISABLED}), .btn.btn-light:focus-visible { background-color: var(--aegis-btn-light-hover, ${btnLightHover}); border-color: ${gray[3]}; } .btn.btn-light:focus-visible { outline-color: var(--aegis-btn-light, ${btnLight}); } .btn.btn-light:active { background-color: var(--aegis-btn-light-active, ${btnLightActive}); border-color: ${gray[4]}; }`; const btnOutlineLight = css`.btn.btn-outline-light { background-color: transparent; color: var(--aegis-btn-light, ${btnLight}); border-color: currentColor; } .btn.btn-outline-light:hover:not(${DISABLED}), .btn.btn-outline-light:focus-visible { background-color: var(--aegis-btn-light-hover, ${btnLightHover}); border-color: ${gray[3]}; color: var(--aegis-color-light, ${colorLight}); } .btn.btn-outline-light:focus-visible { outline-color: var(--aegis-btn-light, ${btnLight}); } .btn.btn-outline-light:active { background-color: var(--aegis-btn-light-active, ${btnLightActive}); border-color: ${gray[4]}; color: var(--aegis-btn-light-active, ${btnLightActive}); }`; const dark = css`.btn.btn-dark { background-color: var(--aegis-btn-dark, ${btnDark}); color: var(--aegis-color-dark, ${colorDark}); border-color: ${gray[7]}; } .btn.btn-dark:hover:not(${DISABLED}), .btn.btn-dark:focus-visible { background-color: var(--aegis-btn-dark-hover, ${btnDarkHover}); border-color: ${gray[8]}; } .btn.btn-dark:focus-visible { outline-color: var(--aegis-btn-dark, ${btnDark}); } .btn.btn-dark:active { background-color: var(--aegis-btn-dark-active, ${btnDarkActive}); border-color: ${gray[9]}; }`; const btnOutlineDark = css`.btn.btn-outline-dark { background-color: transparent; color: var(--aegis-btn-dar, ${btnDark}); border-color: currentColor; } .btn.btn-outline-dark:hover:not(${DISABLED}), .btn.btn-outline-dark:focus-visible { background-color: var(--aegis-btn-dark-hover, ${btnDarkHover}); border-color: ${gray[8]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-dark:focus-visible { outline-color: var(--aegis-btn-dark, ${btnDark}); } .btn.btn-outline-dark:active { background-color: var(--aegis-btn-dark-active, ${btnDarkActive}); border-color: ${gray[9]}; color: var(--aegis-color-dark, ${colorDark}); } .btn.btn-outline-secondary:disabled, .btn.btn-outline-secondary.disabled, .btn.btn-outline-secondary${DISABLED_STATE} { color: var(--aegis-btn-active-disabled, ${btnDisabled}); }`; const link = css`.btn.btn-link { background-color: var(--aegis-btn-link, ${btnLink}); color: ${linkColor}; border-color: transparent; text-decoration: none; } .btn.btn-link:hover:not(${DISABLED}), .btn.btn-link:focus-visible { background-color: var(--aegis-btn-link-hover, ${btnLinkHover}); text-decoration: underline; } .btn.btn-link:focus-visible { outline-color: var(--aegis-btn-link, ${btnLink}); } .btn.btn-link:active { background-color: var(--aegis-btn-link-active, ${btnLinkActive}); text-decoration: underline; }`; const displays = css`.block:not([hidden]):not([popover]) { display: block; } .inline:not([hidden]):not([popover]) { display: inline; } .inline-block:not([hidden]):not([popover]) { display: inline-block; } .flex:not([hidden]):not([popover]) { display: flex; } .inline-flex:not([hidden]):not([popover]) { display: inline-flex; } .grid:not([hidden]):not([popover]) { display: grid; } .inline-grid:not([hidden]):not([popover]) { display: inline-grid; }`; const positions = css`.fixed { position: fixed; } .relative { position: relative; } .absolute { position: absolute; } .sticky { position: sticky; } .top { top: 0; } .bottom { bottom: 0; } .left { left: 0; } .right { right: 0; } .z-0 { z-index: 0; } .z-1 { z-index: 1; } .z-2 { z-index: 2; } .z-3 { z-index: 3; } .z-4 { z-index: 4; } .z-top { z-index: var(--z-top, 9999); } .z-max { z-index: 2147483647; }`; const floats = css`.float-left { float: left; } .float-right { float: right; } .float-none { float: none; } .clear-left { clear: left; } .clear-right { clear: right; } .clear-both { clear: both; }`; const fonts = css`.system-ui { font-family: system-ui, sans-serif; } .ui-sans-serif { font-family: ui-sans-serif, sans-serif; } .ui-serif { font-family: ui-serif, serif; } .ui-monospace { font-family: ui-monospace, monospace; }`; const overflows = css`.overflow-hidden { overflow: hidden; } .overflow-visible { overflow: visible; } .overflow-scroll { overflow: scroll; } .overflow-auto { overflow: auto; } .overflow-x-hidden { overflow-x: hidden; } .overflow-x-visible { overflow-x: visible; } .overflow-x-scroll { overflow-x: scroll; } .overflow-x-auto { overflow-x: auto; } .overflow-y-hidden { overflow-y: hidden; } .overflow-y-visible { overflow-y: visible; } .overflow-y-scroll { overflow-y: scroll; } .overflow-y-auto { overflow-y: auto; }`; const colors = css`.current-color { fill: currentColor; } .color-initial { color: initial; } .color-inherit { color: inherit; }`; const objectFits = css`.fit-contain { object-fit: contain; } .fit-cover { object-fit: cover; } .fit-fill { object-fit: fill; } .fit-none { object-fit: none; } .fit-scale-down { object-fit: scale-down; }`; const textRules = css`.text-align-left { text-align: left; } .text-align-right { text-align: right; } .text-align-center { text-align: center; } .text-align-justify { text-align: justify; } .text-align-justify-all { text-align: justify-all; } .text-align-start { text-align: start; } .text-align-end { text-align: end; } .text-decoration-solid { text-decoration-style: solid; } .text-decoration-wavy { text-decoration-style: wavy; } .text-decoration-dotted { text-decoration-style: dotted; } .text-decoration-dashed { text-decoration-style: dashed; } .text-decoration-double { text-decoration-style: double; } .no-text-decoration, .no-text-decoration * { text-decoration: none; } .underline { text-decoration-line: underline; } .overline { text-decoration-line: overline; } .line-through { text-decoration-line: line-through; } .optimize-speed { text-rendering: optimizeSpeed; } .optimize-legibility { text-rendering: optimizeLegibility; } .geometric-precision { text-rendering: geometricPrecision; } .capitalize { text-transform: capitalize; } .uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; } .center, .align-center { text-align: center; } .align-left { text-align: left; } .align-right { text-align: right; } .indent { text-indent: var(--indent, 4ch); } .indent-all { text-indent: var(--indent, 4ch) each-line; } .indent-hanging { text-indent: var(--indent, 4ch) hanging; }`; const cursors = css`.no-pointer-events { pointer-events: none; } .cursor-auto { cursor: auto; } .cursor-default { cursor: var(--default-cursor, default); } .cursor-none { cursor: none; } .cursor-context-menu { cursor: context-menu; } .cursor-help { cursor: help; } .cursor-pointer { cursor: var(--pointer-cursor, pointer); } .cursor-progress { cursor: var(--progress-cursor, progress); } .cursor-wait { cursor: var(--wait-cursor, wait); } .cursor-cell { cursor: cell; } .cursor-crosshair { cursor: crosshair; } .cursor-text { cursor: text; } .cursor-vertical-text, .cursor-text-vertical { cursor: vertical-text; } .cursor-alias { cursor: alias; } .cursor-copy { cursor: copy; } .cursor-move { cursor: move; } .cursor-no-drop { cursor: no-drop; } .cursor-not-allowed { cursor: not-allowed; } .cursor-all-scroll { cursor: all-scroll; } .cursor-col-resize { cursor: col-resize; } .cursor-row-resize { cursor: row-resize; } .cursor-n-resize { cursor: n-resize; } .cursor-e-resize { cursor: e-resize; } .cursor-s-resize { cursor: s-resize; } .cursor-w-resize { cursor: w-resize; } .cursor-ne-resize { cursor: ne-resize; } .cursor-nw-resize { cursor: nw-resize; } .cursor-se-resize { cursor: se-resize; } .cursor-sw-resize { cursor: sw-resize; } .cursor-zoom-in { cursor: zoom-in; } .cursor-zoom-out { cursor: zoom-out; } .cursor-grab { cursor: grab; } .cursor-grabbing { cursor: grabbing; }`; const utilities = css`.clearfix::after { clear: both; content: ''; display: block; } .shadow { box-shadow: var(--shadow-x, 0) var(--shadow-y, 2px) var(--shadow-blur, 10px) var(--shadow-spread, 0) var(--shadow-color, rgba(0,0,0,.2)); } .shadow-dark { box-shadow: var(--shadow-x, 0) var(--shadow-y, 2px) var(--shadow-blur, 10px) var(--shadow-spread, 0) var(--shadow-dark-color, rgba(0,0,0,.6)); } .icon, .icon * { color: inherit; max-width: 100%; max-height: 100%; width: var(--icon-size, 1em); height: var(--icon-size, 1em); vertical-align: middle; } .round { border-radius: 50%; } .card { border: var(--card-border, 1px solid #ccc); border-radius: var(--card-radius, 2px); background: var(--card-bg, var(--primary-color, white)); padding: var(--card-padding, 0.7em); } .custom-element:not(:defined) .if-defined[slot], .custom-element.if-defined:not(:defined) { display: none; }`; const statusBoxes = css`.status-box { padding: 1.2em; border: 1px dashed currentColor; text-align: center; margin-top: 0.7em; border-radius: 8px; } .status-box.alert, .status-box.error { color: var(--alert-color, #6f0606); background-color: var(--alert-background, #e88a8a); } .status-box.warn { color: var(--warn-color, #51430c); background-color: var(--warn-background, #f0d155); } .status-box.info { color: var(--info-color, #555553); background-color: var(--info-background, #d2d2d2); } .status-box.success { color: var(--success-color, #1d4f01); background-color: var(--success-background, #8cee69); }`; const forms = css`.form-group { border: 1px solid transparent; padding: var(--form-group-padding, 0.4em 0.8em); margin-bottom: 0.4em; border-radius: 6px; transition: border-color 200ms ease-in-out; } .form-group:focus-within { border-color: var(--form-group-border, #cacaca); } .form-group .input-label { display: block; margin: 0.4em 0; } .form-group .input-label.required::after { content: ' *'; display: inline; font-size: 0.8em; font-weight: 800; } .form-group .input, .form-group .input:required:invalid:placeholder-shown { display: block; width: var(--input-width, 100%); max-width: 100%; color: currentColor; border-style: solid; border-color: var(--input-border, #cacaca); border-width: 0 0 1px 0; background: transparent; padding: var(--form-group-padding, 0.5em 0.3em); transition: color 300ms ease-in-out, background-color 300ms ease-in-out; } .form-group textarea.input { resize: vertical; } .form-group .input:invalid { box-shadow: none; } .form-group .input:invalid:not(:focus) { color: var(--invalid-color, #-871717); border-color: currentColor; background-color: var(--invalid-background, #F7C1C1); } .form-group input[hidden] + label[for].btn-toggle { background-color: var(--button-disabled-background); margin: var(--form-group-margin, 0.3rem); transition: background-color 300ms ease-in-out; } .form-group input[hidden]:checked + label[for].btn-toggle { background-color: var(--button-background); } .form-group input[hidden]:not(:checked) + label[for].btn-toggle .when-checked { display: none; } .form-group input[hidden]:checked + label[for].btn-toggle .when-unchecked { display: none; }`; const scrollbarFallback = css`@supports not (scrollbar-color: currentColor transparent) { ::-webkit-scrollbar { display: block; } ::-webkit-scrollbar-thumb { background-color: var(--aegis-scrollbar-color, ${scrollbarColor}); } ::-webkit-scrollbar-track { background-color: var(--aegis-scrollbar-track, ${scrollbarTrack}); } }`; const scrollbar = css`:root { scrollbar-color: var(--aegis-scrollbar-color, ${scrollbarColor}) var(--aegis-scrollbar-track, ${scrollbarTrack}); scrollbar-width: var(----aegis-scrollbar-width, auto); }`; const componentScrollbar = css`:host { scrollbar-color: var(--aegis-scrollbar-color, ${scrollbarColor}) var(--aegis-scrollbar-track, ${scrollbarTrack}); scrollbar-width: var(----aegis-scrollbar-width, auto); }`; const transform = css`.transform-origin-center { transform-origin: center; } .transform-origin-top { transform-origin: top; } .transform-origin-bottom { transform-origin: bottom; } .transform-origin-left { transform-origin: left; } .transform-origin-right { transform-origin: right; } .transform-origin-top-center { transform-origin: top center; } .transform-origin-top-left { transform-origin: top left; } .transform-origin-top-right { transform-origin: top right; } .transform-origin-bottom-left { transform-origin: bottom left; } .transform-origin-bottom-right { transform-origin: bottom right; }`; const transition = css`.transition-linear { transition-timing-function: linear; } .transition-ease { transition-timing-function: ease; } .transition-ease-in { transition-timing-function: ease-in; } .transition-ease-out { transition-timing-function: ease-out; } .transition-ease-in-out { transition-timing-function: ease-in-out; } .transition-speed-blink { transition-duration: var(--aegis-blink-speed, 200ms); } .transition-speed-fast { transition-duration: var(--aegis-fast-speed, 400ms); } .transition-speed-normal { transition-duration: var(--aegis-normal-speed, 600ms); } .transition-speed-slow { transition-duration: var(--aegis-slow-speed, 800ms); } .transition-speed-crawl { transition-duration: var(--aegis-crawl-speed, 1600ms); } .transition-none { transition-property: none; } .transition-all { transition-property: all; } .transition-transform { transition-property: transform; } .transition-opacity { transition-property: opacity; } .transition-filter { transition-property: filter; } .transition-background-position { transition-property: background-position; } .transition-top { transition-property: top; } .transition-right { transition-property: right; } .transition-bottom { transition-property: bottom; } .transition-left { transition-property: left; } .transition-margin { transition-property: margin; } .transition-padding { transition-property: padding; } .transtion-color { transition-property: color; } .transition-background-color { transition-property: background-color; } .transition-color { transition-property: color; } .transition-background { transition-property: background; } .transition-width { transition-property: width; } .transition-height { transition-property: height; } .transition-max-width { transition-property: max-width; } .transition-max-height { transition-property: max-height; } .transition-stagger > :nth-child(5n+1) { transition-delay: calc(1 * var(--aegis-transition-stagger, 200ms)); } .transition-stagger > :nth-child(5n+2) { transition-delay: calc(2 * var(--aegis-transition-stagger, 200ms)); } .transition-stagger > :nth-child(5n+3) { transition-delay: calc(3 * var(--aegis-transition-stagger, 200ms)); } .transition-stagger > :nth-child(5n+4) { transition-delay: calc(4 * var(--aegis-transition-stagger, 200ms)); } .transition-stagger > :nth-child(5n+5) { transition-delay: calc(5 * var(--aegis-transition-stagger, 200ms)); }`; const animate = css`.animation-trampoline { animation-name: trampoline; } .animation-fade-in { animation-name: fade-in; } .animation-fade-out { animation-name: fade-out; } .animation-shrink { animation-name: shrink; } .animation-grow { animation-name: grow; } .animation-fly-in { animation-name: fly-in; } .animation-slide-up { animation-name: slide-up; } .animation-flip-down { animation-name: flip-down; } .animation-tear-off { animation-name: tear-off; } .animation-blink { animation-name: blink; } .animation-paused { animation-play-state: paused; } .animation-running { animation-play-state: running; } .animation-speed-blink { animation-duration: var(--aegis-blink-speed, 200ms); } .animation-speed-fast { animation-duration: var(--aegis-fast-speed, 400ms); } .animation-speed-normal { animation-duration: var(--aegis-normal-speed, 600ms); } .animation-speed-slow { animation-duration: var(--aegis-slow-speed, 800ms); } .animation-speed-crawl { animation-duration: var(--aegis-crawl-speed, 1200ms); } .animation-infinite { animation-iteration-count: infinite; } .animation-alternate { animation-direction: alternate; } .animation-reverse { animation-direction: reverse; } .animation-alternate-reverse { animation-direction: alternate-reverse; } .animation-normal { animation-direction: normal; } .animation-fill-forwards { animation-fill-mode: forwards; } .animation-fill-backwards { animation-fill-mode: backwards; } .animation-fill-both { animation-fill-mode: both; } .animation-fill-none { animation-fill-mode: none; } .animation-linear { animation-timing-function: linear; } .animation-ease { animation-timing-function: ease; } .animation-ease-in { animation-timing-function: ease-in; } .animation-ease-out { animation-timing-function: ease-out; } .animation-ease-in-out { animation-timing-function: ease-in-out; } .animation-overshoot { animation-timing-function: cubic-bezier(.59,1.16,.83,1.11); } .animation-stagger > :nth-child(5n+1) { animation-delay: calc(1 * var(--aegis-animation-stagger, 200ms)); } .animation-stagger > :nth-child(5n+2) { animation-delay: calc(2 * var(--aegis-animation-stagger, 200ms)); } .animation-stagger > :nth-child(5n+3) { animation-delay: calc(3 * var(--aegis-animation-stagger, 200ms)); } .animation-stagger > :nth-child(5n+4) { animation-delay: calc(4 * var(--aegis-animation-stagger, 200ms)); } .animation-stagger > :nth-child(5n+5) { animation-delay: calc(5 * var(--aegis-animation-stagger, 200ms)); }`; const keyframes = css`@keyframes trampoline { from { transform: scaleY(.85); filter: drop-shadow(0 0.3em 0.1em rgba(0,0,0,0.7)); } to { filter: drop-shadow(0 0.7em 0.3em rgba(0,0,0,0.7)); transform: translateY(-1.2em); } } @keyframes fade-in { from { opacity: 0; } } @keyframes fade-out { to { opacity: 0; } } @keyframes shrink { to { transform: scale(0); } } @keyframes grow { from { transform: scale(0); } } @keyframes fly-in { from { transform: translate(100vw, -3vh) scaleX(0.1) skew(-20deg); } } @keyframes flip-down { from { transform: rotateX(-90deg); } } @keyframes tear-off { 40% { transform: rotateZ(30deg) rotateX(40deg) skew(-20deg); } 99% { transform: rotateZ(40deg) translate(-30vw, 120vh) skew(20deg); opacity: 1; } to { opacity: 0; } } @keyframes slide { from { left: 100%; } to { left: 0; } } @keyframes slide-up { from { top: 100%; } to { top: 0%; } } @keyframes progress { to { background-position: right; } } @keyframes hanger { from { transform: rotateX(-90deg); transform-origin: center -40%; } } @keyframes door { from { transform: rotateY(90deg); } } @keyframes sidekick { from { left: 100%; transform: rotate(270deg) scale(0); } } @keyframes cube { from { left: 100%; transform: matrix(0.133,-0.489,-0.200,2.489,-100.667,80.000); } } @keyframes shine { 0% { text-shadow: 4px 8px 2px #ddd; } 25% { text-shadow: 4px -8px 2px #ddd; } 50% { text-shadow: -2px -8px 2px #ddd; } 75% { text-shadow: -2px 8px 2px #ddd; } 100% { text-shadow: 4px 8px 2px #ddd; } } @keyframes blink { from { opacity: 0; } }`; async function sheetToFile(sheet, { filename = 'styles.css' } = {}) { const { promise, resolve, reject } = Promise.withResolvers(); requestAnimationFrame(() => { try { resolve(new File( Array.from(sheet.rules, rule => rule.cssText), filename, { type: 'text/css' } )); } catch(err) { reject(err); } }); return promise; } async function sheetToLink(sheet, { crossOrigin = 'anonymous', referrerPolicy = 'no-referrer', fetchPriority = 'auto', integrity, blocking, } = {}) { const link = document.createElement('link'); link.relList.add('stylesheet'); link.referrerPolicy = referrerPolicy; link.fetchPriority = fetchPriority; if (typeof integrity === 'string') { link.integrity = integrity; } if (typeof crossOrigin === 'string') { link.crossOrigin = crossOrigin; } if (typeof blocking === 'string') { link.blocking = blocking; } if (typeof sheet.media === 'string') { link.media = sheet.media; } if (sheet.disabled) { link.disabled = true; } link.href = URL.createObjectURL(await sheetToFile(sheet)); return link; } function registerProperties(props) { if (! (CSS.registerProperty instanceof Function)) { return new Error('`CSS.registerProperty` is not supported.'); } else { const errs = []; Object.entries(props).forEach(([name, { initialValue, syntax = '*', inherits = true }]) => { try { CSS.registerProperty({ name: `--aegis-${name}`, syntax, initialValue, inherits }); } catch(err) { errs.push(err); } }); switch(errs.length) { case 0: return null; case 1: return errs[0]; default: return new AggregateError(errs, 'Error registering custom properties.'); } } } exports.SUPPORTS_CUSTOM_STATES = SUPPORTS_CUSTOM_STATES; exports.animate = animate; exports.baseTheme = baseTheme; exports.bootstrap = bootstrap; exports.btn = btn; exports.btnDanger = danger; exports.btnDark = dark; exports.btnInfo = info; exports.btnLight = light; exports.btnLink = link; exports.btnOutlineDanger = btnOutlineDanger; exports.btnOutlineDark = btnOutlineDark; exports.btnOutlineInfo = btnOutlineInfo; exports.btnOutlineLight = btnOutlineLight; exports.btnOutlinePrimary = btnOutlinePrimary; exports.btnOutlineSecondary = btnOutlineSecondary; exports.btnOutlineSuccess = btnOutlineSuccess; exports.btnOutlineWarning = btnOutlineWarning; exports.btnPrimary = primary; exports.btnSecondary = secondary; exports.btnSuccess = success; exports.btnSystem = system; exports.btnSystemAccent = systemAccent; exports.btnWarning = warning; exports.colors = colors; exports.componentBase = componentBase; exports.componentBorder = componentBorder; exports.componentDarkTheme = componentDarkTheme; exports.componentLightTheme = componentLightTheme; exports.componentScrollbar = componentScrollbar; exports.cursors = cursors; exports.customProperties = customProperties; exports.darkTheme = darkTheme; exports.displays = displays; exports.floats = floats; exports.fonts = fonts; exports.forms = forms; exports.gnome = gnome; exports.keyframes = keyframes; exports.lightTheme = lightTheme; exports.objectFits = objectFits; exports.overflows = overflows; exports.palette = aegis; exports.positions = positions; exports.properties = properties; exports.propertiesLegacy = propertiesLegacy; exports.registerProperties = registerProperties; exports.reset = reset; exports.scrollbar = scrollbar; exports.scrollbarFallback = scrollbarFallback; exports.sheetToFile = sheetToFile; exports.sheetToLink = sheetToLink; exports.statusBoxes = statusBoxes; exports.textRules = textRules; exports.transform = transform; exports.transition = transition; exports.utilities = utilities;