Utility classes for changing an element's background position property. Includes center, single axis, and double axis variants. Background position affects only the background image position similar to aligning an absolute element.

Classes for background position are named using the format: [bg]-[axis]-[position].

Where axis includes:

  • center - for background-position: center
  • x - for background-position-x
  • y - for background-position-y
  • xy - for background-position-x & background-position-y

Where position includes:

  • left - for background-position-x: left 0px
  • right - for background-position-x: right 0px
  • top - for background-position-y: top 0px
  • bottom - for background-position-y: bottom 0px
  • bottom-left - for background-position-x: bottom 0px & background-position-y: left 0px
  • bottom-right - for background-position-x: bottom 0px & background-position-y: right 0px
  • top-left - for background-position-x: top 0px & background-position-y: left 0px
  • top-right - for background-position-x: top 0px & background-position-y: right 0px
ClassContents

Note that background-position: center is the default value for background position in Unity. Unless the value needs to be overridden from a parent, the bg-center class is not needed.

UXML

UXML

UXML

UXML