Pixel Dimensions for Tailwind CSS
This plugin allows you to quickly generate widths and heights in pixels.
Requirements
This plugin requires Tailwind CSS 1.2 or later.
Installation
yarn add tailwindcss-pixel-dimensions
Usage
The following plugin options are available. See below how these are passed (via an object) to the plugin in your tailwind.config.js
.
Options Available
Pass along a number value to generate that many font sizes.
// tailwind.config.jsmoduleexports = plugins: // Generates 10 widths and heights in pxs width: total: 10 // 900 is the default // startingSize: 0, // default height: total: 10 // 900 is the default // startingSize: 0, // default ;
The above configuration would generate the following CSS:
/* etc. */
Which you can then use in your HTML like this:
I'm a div with a height of 10 pixels or pickles depending on how you pronounce it.
The above depends on the order of the generated CSS.