3.1.1 • Published 3 years ago
@benface/tailwindcss-reset v3.1.1
Opinionated Reset Plugin for Tailwind CSS
Requirements
This plugin requires Tailwind CSS 1.2 or later, and is optimized for Tailwind CSS 3.x.
Installation
npm install @benface/tailwindcss-resetUsage
// tailwind.config.js
module.exports = {
corePlugins: {
preflight: true /* the plugin extends Preflight so make sure it is not disabled */,
},
plugins: [require("@benface/tailwindcss-reset")],
};What it does
- Makes everything
position: relative, so that absolutely positioned elements are relative to their parent by default. - Resets the
marginandpaddingof all elements to0. - Resets the
min-widthandmin-heightof all elements to0, since the default isautowhich can cause overflow issues with flex items. - Resets
border-radiusto0,background-colortotransparent, andbackground-imagetononeon all elements, just in case. - Sets better defaults for
background-position(center center) andbackground-repeat(no-repeat). - Makes some elements
display: blockby default (button,input,select,textarea,label, andsummary). - Makes the inheritable text properties (
color,font,text-align,text-transform, andletter-spacing) inherit on form elements as well (button,input, etc.). - Changes the default
overflowonsvgelements fromhiddentovisible, to prevent clipping their edges (notably in Safari). - Removes opinionated styles set by user agent stylesheets and/or Preflight (see
reset.cssto see them all). - Enforces
display: noneon[hidden]elements by adding!importantso that it cannot be overridden by utility classes.
What it does not do
- It doesn’t remove the default focus rings, as not all projects need custom focus styles.
- It doesn’t override the
font-weight: bolderonbandstrongelements. - It doesn’t override the
font-style: italiconiandemelements. - It doesn’t override the
text-decoration: underlineonuandinselements. - It doesn’t override the
text-decoration: line-throughons,strike, anddelelements. - It doesn’t override the
font-sizeand positioning styles set by Preflight onsubandsupelements.