README
Opinionated Reset Plugin for Tailwind CSS
Requirements
This plugin requires Tailwind CSS 1.2 or later. If your project uses an older version of Tailwind, you should install the latest 1.x version of this plugin (npm install @benface/tailwindcss-reset@1.x).
Installation
npm install @benface/tailwindcss-reset
Usage
// 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
A few things:
- Makes everything
position: relative, so that absolutely positioned elements are relative to their parent by default - Resets the
min-widthandmin-heightof all elements to0, since the default isautowhich can cause overflow issues with flex items - Changes
background-position’s default value fromleft toptocenter center - Changes
background-repeat’s default value fromrepeattono-repeat - Removes default styles on form elements (border radius, background color, inherit all the font/text properties that usually inherit, etc.)
- Removes other opinionated styles set by user agent stylesheets (see
reset.cssto see them all) - Enforces
display: noneon[hidden]elements by adding!importantso that it is not overridden by utility classes