UNPKG

@cimpress/react-components

Version:
275 lines (235 loc) 4.87 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GlobalStyles = void 0; /* eslint-disable react/jsx-no-useless-fragment */ const react_1 = __importDefault(require("react")); const css_1 = require("@emotion/css"); const cvar_1 = __importDefault(require("./theme/cvar")); const globalStyles = (0, css_1.css) ` * { margin: 0; padding: 0; font-size: 1em; font-family: inherit; } body { font: ${(0, cvar_1.default)('text-paragraph-default')}; color: ${(0, cvar_1.default)('color-text-default')}; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .h7 { margin-top: 1em; margin-bottom: 0.5em; } h1, .h1 { font: ${(0, cvar_1.default)('text-h1')}; } h2, .h2 { font: ${(0, cvar_1.default)('text-h2')}; } h3, .h3 { font: ${(0, cvar_1.default)('text-h3')}; } h4, .h4 { font: ${(0, cvar_1.default)('text-h4')}; } h5, .h5 { font: ${(0, cvar_1.default)('text-h5')}; } h6, .h6 { font: ${(0, cvar_1.default)('text-h6')}; } .h7 { font: ${(0, cvar_1.default)('text-h7')}; color: ${(0, cvar_1.default)('color-text-label')}; } a { color: ${(0, cvar_1.default)('color-text-interactive')}; text-decoration: none; &:hover { color: ${(0, cvar_1.default)('color-text-hover')}; text-decoration: underline; } &:active { color: ${(0, cvar_1.default)('color-text-selected')}; text-decoration: underline; } } code, kbd, pre, samp { font-family: ${(0, cvar_1.default)('font-monospace')}; } code { padding: 2px 4px; font-size: 90%; border-radius: 2px; } pre { display: block; padding: ${(0, cvar_1.default)('spacing-8')}px; margin: 0 0 9px; font-size: 13px; line-height: 1.286; word-break: break-all; word-wrap: break-word; border: 1px solid; border-radius: 2px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; } @font-face { font-family: 'Open Sans', 'Segoe UI', Tahoma, sans-serif; font-style: normal; font-weight: 400; src: local('Open Sans'), url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700); } `; // Modified version of modern-normalize v1.1.0 (https://github.com/sindresorhus/modern-normalize) // CSS comments were removed to save on bundle size // Removed some rules to avoid repetition in `globalStyles` const modernNormalizeStyles = (0, css_1.css) ` *, ::before, ::after { box-sizing: border-box; } html { line-height: 1.15; -webkit-text-size-adjust: 100%; -moz-tab-size: 4; tab-size: 4; } body { margin: 0; } hr { height: 0; color: inherit; } abbr[title] { text-decoration: underline dotted; } b, strong { font-weight: bolder; } code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; font-size: 1em; } small { font-size: 85%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sub { bottom: -0.25em; } sup { top: -0.5em; } table { text-indent: 0; border-color: inherit; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, select { text-transform: none; } button, [type='button'], [type='reset'], [type='submit'] { -webkit-appearance: button; cursor: pointer; } ::-moz-focus-inner { border-style: none; padding: 0; } :-moz-focusring { outline: 1px dotted ButtonText; } :-moz-ui-invalid { box-shadow: none; } legend { padding: 0; } progress { vertical-align: baseline; } ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; } [type='search'] { -webkit-appearance: textfield; outline-offset: -2px; } ::-webkit-search-decoration { -webkit-appearance: none; } ::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; } summary { display: list-item; } `; // eslint-disable-next-line @typescript-eslint/no-unused-expressions (0, css_1.injectGlobal) ` ${modernNormalizeStyles}; ${globalStyles}; `; // TODO: migrate to Emotion v11 which uses the `<Global />` component for global styles const GlobalStyles = () => react_1.default.createElement(react_1.default.Fragment, null); exports.GlobalStyles = GlobalStyles; //# sourceMappingURL=GlobalStyles.js.map