Utilities for controlling the style of an element's borders.
<div class="border-solid border-4 border-light-blue-500 ..."></div>
<div class="border-dashed border-4 border-light-blue-500 ..."></div>
<div class="border-dotted border-4 border-light-blue-500 ..."></div>
<div class="border-double border-4 border-light-blue-500 ..."></div>
<div class="border-none border-4 border-light-blue-500 ..."></div>
To control the border style of an element at a specific breakpoint, add a {screen}:
prefix to any existing border style utility. For example, use md:border-dotted
to apply the border-dotted
utility at only medium screen sizes and above.
<div class="border-solid md:border-dotted ..."></div>
For more information about Tailwind’s responsive design features, check out the Responsive Design documentation.
By default, only responsive variants are generated for border style utilities.
You can control which variants are generated for the border style utilities by modifying the borderStyle
property in the variants
section of your tailwind.config.js
file.
For example, this config will also generate hover and focus variants:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
+ borderStyle: ['hover', 'focus'],
}
}
}
If you don't plan to use the border style utilities in your project, you can disable them entirely by setting the borderStyle
property to false
in the corePlugins
section of your config file:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
+ borderStyle: false,
}
}