Tailwind CSS plugin for Lob's design system
npm install tailwind-plugin-lob``bash`
npm i tailwind-plugin-lob -Dtailwind.config.jsUsage
Add tailwind-plugin-lob to the plugins section of your file.
`js`
module.exports = {
plugins: [
require('tailwind-plugin-lob')
]
};
The following core plugins have been customized for Lob
- screens
- colors
- fontSize
- fontFamily
- fill
- a fill class is created for each color in our theme
- boxShadow
The following core plugins have been extended for Lob
- borderWidth: to add a 3px border with border-3m-4.5
- spacing: to add a spacing of 1.125rem with or p-4.5
The following variants have been turned on for a subset of core plugins
- disabled
- backgroundColor
- borderColor
- textColor
- group-hover (see Tailwind's docs for an explanation of this variant)
- translate
. For example, the palette below would have:
- flint-900 as the darkest shade
- flint-700
- flint as the base (middle) color
- flint-300
- flint-100 as the lightest shadeThis naming convention allows us to preserve the design system's original names, adhere to general Tailwind color conventions, and in addition to providing flexibility if more shades were to be introduced in the future.
$3
#### Border side colorsBy default Tailwind does not allow you to control the color of each side of a border individually. To support CSS triangles and other complex styles, you may need to style each side separately.
We have a border color that creates a class for each side of a border and each color in our theme. The class name format is
border-${side}-${base color}-${numerical shade} like border-r-flint-500.
$3
#### Important
When our 'important' variant is enabled for a core plugin, it allows you to prefix a class with ! to apply !important` to the style. By default this variant has been turned on for a subset of core plugins
- backgroundColor
- borderColor
- textColor
- display