Utility classes for changing an element's border width property. Includes omni-directional, top, right, bottom, left, left/right, and top/bottom variants.

Unity does not support rem/em units, or allow calc() methods in USS files. All border-width classes use px values, and follow the default increment stated unless changed by you. Learn more about Customizing Utility Classes.

Classes for border width are named using the format: [bw]-[direction(s)]-[value]. Direction is optional, and if omitted, will be applied in all 4 directions.

Where direction includes:

  • nothing - for border-width in all 4 directions
  • t - for border-top-width
  • r - for border-right-width
  • b - for border-bottom-width
  • l - for border-left-width
  • x - for border-left-width and border-right-width
  • y - for border-top-width and border-bottom-width

Where value includes:

  • # - px value for that border-width property. By default, border width classes start at 0px, and increment by 1px until stopping at 5px.
ClassContents

Note that border-width: 0px is the default value for border width in Unity. Unless needed for a special case, the bw-0 class is not needed.

bw-1
bw-3
bw-5

UXML

bw-t-1
bw-r-2
bw-b-3
bw-l-4

UXML

bw-x-2
bw-x-4

UXML

bw-y-1
bw-y-3

UXML