Tailwind CSS BG Alpha Plugin
Utility for adding background, border and text colors alpha.
Requirements
- Tailwind CSS >= v1.0.0
Installation
Install via NPM:
npm i --save-dev tailwindcss-bg-alpha
Install via YARN:
yarn add tailwindcss-bg-alpha
Usage
// tailwind.config.jsmoduleexports =// ...plugins:// ...
This plugin generates the following utilities:
Utilities generated are: bg, border and text
Ranges value for alpha: 0 to 100
Default colors are: white and black
Custom colors
// tailwind.config.jsmoduleexports =// ...alphaColors: 'red.500' 'gray.200' 'yourcustomcolor.500'// ...
important use .
for separate color name (e.g. red) to color variant (e.g. 500)
Custom values
// tailwind.config.jsmoduleexports =// ...alphaValues: 012 074 087// ...
important use .
for separate decimal (e.g. 0.12). Range 0 to 1
License
Tailwind BG Alpha provided under the MIT License.