UNPKG

@chakra-ui/css-reset

Version:

CSS reset component for Chakra UI

1 lines 8.42 kB
{"version":3,"sources":["../src/css-reset.tsx"],"sourcesContent":["import { Global } from \"@emotion/react\"\n\nconst css = String.raw\n\nconst vhPolyfill = css`\n :root,\n :host {\n --chakra-vh: 100vh;\n }\n\n @supports (height: -webkit-fill-available) {\n :root,\n :host {\n --chakra-vh: -webkit-fill-available;\n }\n }\n\n @supports (height: -moz-fill-available) {\n :root,\n :host {\n --chakra-vh: -moz-fill-available;\n }\n }\n\n @supports (height: 100dvh) {\n :root,\n :host {\n --chakra-vh: 100dvh;\n }\n }\n`\n\nexport const CSSPolyfill = () => <Global styles={vhPolyfill} />\n\nexport type CSSResetProps = {\n /**\n * The selector to scope the css reset styles to.\n */\n scope?: string\n}\n\nexport const CSSReset = ({ scope = \"\" }: CSSResetProps) => (\n <Global\n styles={css`\n html {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n font-family: system-ui, sans-serif;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n -moz-osx-font-smoothing: grayscale;\n touch-action: manipulation;\n }\n\n body {\n position: relative;\n min-height: 100%;\n margin: 0;\n font-feature-settings: \"kern\";\n }\n\n ${scope} :where(*, *::before, *::after) {\n border-width: 0;\n border-style: solid;\n box-sizing: border-box;\n word-wrap: break-word;\n }\n\n main {\n display: block;\n }\n\n ${scope} hr {\n border-top-width: 1px;\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n }\n\n ${scope} :where(pre, code, kbd,samp) {\n font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 1em;\n }\n\n ${scope} a {\n background-color: transparent;\n color: inherit;\n text-decoration: inherit;\n }\n\n ${scope} abbr[title] {\n border-bottom: none;\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n\n ${scope} :where(b, strong) {\n font-weight: bold;\n }\n\n ${scope} small {\n font-size: 80%;\n }\n\n ${scope} :where(sub,sup) {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n\n ${scope} sub {\n bottom: -0.25em;\n }\n\n ${scope} sup {\n top: -0.5em;\n }\n\n ${scope} img {\n border-style: none;\n }\n\n ${scope} :where(button, input, optgroup, select, textarea) {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n }\n\n ${scope} :where(button, input) {\n overflow: visible;\n }\n\n ${scope} :where(button, select) {\n text-transform: none;\n }\n\n ${scope} :where(\n button::-moz-focus-inner,\n [type=\"button\"]::-moz-focus-inner,\n [type=\"reset\"]::-moz-focus-inner,\n [type=\"submit\"]::-moz-focus-inner\n ) {\n border-style: none;\n padding: 0;\n }\n\n ${scope} fieldset {\n padding: 0.35em 0.75em 0.625em;\n }\n\n ${scope} legend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n }\n\n ${scope} progress {\n vertical-align: baseline;\n }\n\n ${scope} textarea {\n overflow: auto;\n }\n\n ${scope} :where([type=\"checkbox\"], [type=\"radio\"]) {\n box-sizing: border-box;\n padding: 0;\n }\n\n ${scope} input[type=\"number\"]::-webkit-inner-spin-button,\n ${scope} input[type=\"number\"]::-webkit-outer-spin-button {\n -webkit-appearance: none !important;\n }\n\n ${scope} input[type=\"number\"] {\n -moz-appearance: textfield;\n }\n\n ${scope} input[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n ${scope} input[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none !important;\n }\n\n ${scope} ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n ${scope} details {\n display: block;\n }\n\n ${scope} summary {\n display: list-item;\n }\n\n template {\n display: none;\n }\n\n [hidden] {\n display: none !important;\n }\n\n ${scope} :where(\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre\n ) {\n margin: 0;\n }\n\n ${scope} button {\n background: transparent;\n padding: 0;\n }\n\n ${scope} fieldset {\n margin: 0;\n padding: 0;\n }\n\n ${scope} :where(ol, ul) {\n margin: 0;\n padding: 0;\n }\n\n ${scope} textarea {\n resize: vertical;\n }\n\n ${scope} :where(button, [role=\"button\"]) {\n cursor: pointer;\n }\n\n ${scope} button::-moz-focus-inner {\n border: 0 !important;\n }\n\n ${scope} table {\n border-collapse: collapse;\n }\n\n ${scope} :where(h1, h2, h3, h4, h5, h6) {\n font-size: inherit;\n font-weight: inherit;\n }\n\n ${scope} :where(button, input, optgroup, select, textarea) {\n padding: 0;\n line-height: inherit;\n color: inherit;\n }\n\n ${scope} :where(img, svg, video, canvas, audio, iframe, embed, object) {\n display: block;\n }\n\n ${scope} :where(img, video) {\n max-width: 100%;\n height: auto;\n }\n\n [data-js-focus-visible]\n :focus:not([data-focus-visible-added]):not(\n [data-focus-visible-disabled]\n ) {\n outline: none;\n box-shadow: none;\n }\n\n ${scope} select::-ms-expand {\n display: none;\n }\n\n ${vhPolyfill}\n `}\n />\n)\n\nexport default CSSReset\n"],"mappings":";;;AAAA,SAAS,cAAc;AAgCU;AA9BjC,IAAM,MAAM,OAAO;AAEnB,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,IAAM,cAAc,MAAM,oBAAC,UAAO,QAAQ,YAAY;AAStD,IAAM,WAAW,CAAC,EAAE,QAAQ,GAAG,MACpC;AAAA,EAAC;AAAA;AAAA,IACC,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAkBJ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAWL,KA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