tailwindcss/docs/source/docs/border-width.blade.md
Michaël De Boey d62cf62e87
borderWidths
2017-12-02 18:14:25 +01:00

3 KiB

extends title description features
_layouts.documentation Border Width Utilities for controlling the width an element's borders.
responsive customizable hover focus
true true false false

@include('_partials.work-in-progress')

Add borders to any element using the .border{-side?}{-width?} syntax.

For example, .border would add a 1px border to all sides of the element, where .border-b-4 would add a 4px border to the bottom of the element.

Class
border
Side (optional)
  All (default)
t Top
r Right
b Bottom
l Left
Width (optional)
0 0px
  1px (default)
2 2px
4 4px
8 8px

Customizing

Responsive, Hover, and Focus Variants

By default, no hover, focus, or group-hover variants are generated for border width utilities.

You can control which variants are generated for the border width utilities by modifying the borderWidths property in the modules section of your Tailwind config file.

For example, this config will also generate hover and focus variants:

{
    // ...
    modules: { 
        // ...
        borderWidths: ['responsive', 'hover', 'focus'],
    }
}

Disabling

If you aren't using the border width utilities in your project, you can disable them entirely by setting the borderWidths property to false in the modules section of your config file:

{
    // ...
    modules: {
        // ...
        borderWidths: false,
    }
}