├── LICENSE ├── README.md └── reset.css /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Nathaniel Sabanski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ♻️ Tiny CSS Reset 2 | Under 12 line modern vanilla CSS reset. Copy, paste and go! 3 | 4 | https://github.com/gnat/css-reset-tiny/blob/44f4ad42838e88a13b4416e99391b5cd3795ce95/reset.css#L1-L12 5 | 6 | * Not opinionated- only exists for sane, consistent defaults. 7 | * Resets already widely available are removed. 8 | * This is a modernised [minireset.css](https://github.com/jgthms/minireset.css) 9 | * We include useful stuff from [Tailwind preflight.css](https://github.com/tailwindlabs/tailwindcss/blob/next/packages/tailwindcss/preflight.css) 10 | * Some extras from [Modern CSS Reset (September 2023)](https://andy-bell.co.uk/a-more-modern-css-reset/) 11 | * Some extras from Jen Simmons' [remedy.css](https://github.com/jensimmons/cssremedy/blob/master/css/remedy.css) 12 | -------------------------------------------------------------------------------- /reset.css: -------------------------------------------------------------------------------- 1 | /* ♻️ Tiny CSS Reset (https://github.com/gnat/css-reset-tiny) */ 2 | *,::before,::after,::backdrop,::file-selector-button { box-sizing: border-box; margin: 0; } /* Prevent padding and border from affecting element width. Remove margins. */ 3 | html { text-size-adjust: none; -webkit-text-size-adjust: none; -moz-text-size-adjust: none; tab-size: 4; line-height: 1.5; } /* Prevent font size inflation on mobile. Sane tab size, line height. */ 4 | html,body { background: #aaa; line-height: inherit; } /* Disable screen flashbang. */ 5 | html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6,label,table,td,th { padding: 0; } /* No padding. */ 6 | h1,h2,h3,h4,h5,h6,p { font-size: inherit; font-weight: inherit; overflow-wrap: break-word; } /* Reset all headers and
. */ 7 | h1,h2,h3,h4 { text-wrap: balance; line-height: 1; } /* Balance text on big headers. Reset line height. */ 8 | button,input,select,textarea { font: inherit; } /* No custom font on forms. */ 9 | img,picture,svg,video { height: auto; max-width: 100%; } /* Media should not break outside of parent. */ 10 | audio,canvas,embed,iframe,img,object,svg,video { vertical-align: middle; } /* Removes tiny space on bottom. */ 11 | table { text-indent: 0; border-color: inherit; border-collapse: collapse; border-spacing: 0; } /* Modern tables. */ 12 | [hidden] { display: none !important; } /* Hidden elements stay hidden. */ 13 | --------------------------------------------------------------------------------