The following table lists the USS properties in UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary Toolkit.
The table indicates which properties are inherited and their animatability. For an inherited property, the element gets the value from its parent element if you don’t specify a value for it. The following example uses an inherited property to set the font for all elements.
:root { -unity-font: resource("Font/consola.ttf"); }
Click the property name to see detailed information about that property.
Note: The usage of a USS property that’s the same as the CSS property links to the Mozilla developer documentation.
Property | Inherited | Animatability | Description |
---|---|---|---|
align-content |
No | Discrete | Alignment of the whole area of children on the cross axis if they span over multiple lines in this container. |
align-items |
No | Discrete | Alignment of children on the cross axis of this container. |
align-self |
No | Discrete | Similar to align-items, but only for this specific element. |
all |
No | Fully animatable | Allows resetting all properties with the initial keyword. Does not apply to custom USS properties. |
background-color |
No | Fully animatable | Background color to paint in the element’s box. |
background-image |
No | Discrete | Background image to paint in the element’s box. |
background-position |
No | Fully animatable | Background image position value. |
background-position-x |
No | Discrete | Background image x position value. |
background-position-y |
No | Discrete | Background image y position value. |
background-repeat |
No | Discrete | Background image repeat value. |
background-size |
No | Fully animatable | Background image size value. Transitions are fully supported only when using size in pixelsThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info See in Glossary or percentages, such as pixel-to-pixel or percentage-to-percentage transitions. |
border-bottom-color |
No | Fully animatable | Color of the element’s bottom border. |
border-bottom-left-radius |
No | Fully animatable | The radius of the bottom-left corner when a rounded rectangle is drawn in the element’s box. |
border-bottom-right-radius |
No | Fully animatable | The radius of the bottom-right corner when a rounded rectangle is drawn in the element’s box. |
border-bottom-width |
No | Fully animatable | Space reserved for the bottom edge of the border during the layout phase. |
border-color |
No | Fully animatable | Shorthand for border-top-color, border-right-color, border-bottom-color, border-left-color |
border-left-color |
No | Fully animatable | Color of the element’s left border. |
border-left-width |
No | Fully animatable | Space reserved for the left edge of the border during the layout phase. |
border-radius |
No | Fully animatable | Shorthand for border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius |
border-right-color |
No | Fully animatable | Color of the element’s right border. |
border-right-width |
No | Fully animatable | Space reserved for the right edge of the border during the layout phase. |
border-top-color |
No | Fully animatable | Color of the element’s top border. |
border-top-left-radius |
No | Fully animatable | The radius of the top-left corner when a rounded rectangle is drawn in the element’s box. |
border-top-right-radius |
No | Fully animatable | The radius of the top-right corner when a rounded rectangle is drawn in the element’s box. |
border-top-width |
No | Fully animatable | Space reserved for the top edge of the border during the layout phase. |
border-width |
No | Fully animatable | Shorthand for border-top-width, border-right-width, border-bottom-width, border-left-width |
bottom |
No | Fully animatable | Bottom distance from the element’s box during layout. |
color |
Yes | Fully animatable | Color to use when drawing the text of an element. |
cursor |
No | Non-animatable | Mouse cursor to display when the mouse pointer is over an element. |
display |
No | Discrete | Defines how an element is displayed in the layout. |
flex |
No | Fully animatable | Shorthand for flex-grow, flex-shrink, flex-basis |
flex-basis |
No | Fully animatable | Initial main size of a flex item, on the main flex axis. The final layout might be smaller or larger, according to the flex shrinking and growing determined by the other flex properties. |
flex-direction |
No | Discrete | Direction of the main axis to layout children in a container. |
flex-grow |
No | Fully animatable | Specifies how the item will grow relative to the rest of the flexible items inside the same container. |
flex-shrink |
No | Fully animatable | Specifies how the item will shrink relative to the rest of the flexible items inside the same container. |
flex-wrap |
No | Discrete | Placement of children over multiple lines if not enough space is available in this container. |
font-size |
Yes | Fully animatable | Font size to draw the element’s text, specified in point size. |
height |
No | Fully animatable | Fixed height of an element for the layout. |
justify-content |
No | Discrete | Justification of children on the main axis of this container. |
left |
No | Fully animatable | Left distance from the element’s box during layout. |
letter-spacing |
Yes | Fully animatable | Increases or decreases the space between characters. |
margin |
No | Fully animatable | Shorthand for margin-top, margin-right, margin-bottom, margin-left |
margin-bottom |
No | Fully animatable | Space reserved for the bottom edge of the margin during the layout phase. |
margin-left |
No | Fully animatable | Space reserved for the left edge of the margin during the layout phase. |
margin-right |
No | Fully animatable | Space reserved for the right edge of the margin during the layout phase. |
margin-top |
No | Fully animatable | Space reserved for the top edge of the margin during the layout phase. |
max-height |
No | Fully animatable | Maximum height for an element, when it is flexible or measures its own size. |
max-width |
No | Fully animatable | Maximum width for an element, when it is flexible or measures its own size. |
min-height |
No | Fully animatable | Minimum height for an element, when it is flexible or measures its own size. |
min-width |
No | Fully animatable | Minimum width for an element, when it is flexible or measures its own size. |
opacity |
No | Fully animatable | Specifies the transparency of an element and of its children. |
overflow |
No | Discrete | How a container behaves if its content overflows its own box. |
padding |
No | Fully animatable | Shorthand for padding-top, padding-right, padding-bottom, padding-left |
padding-bottom |
No | Fully animatable | Space reserved for the bottom edge of the padding during the layout phase. |
padding-left |
No | Fully animatable | Space reserved for the left edge of the padding during the layout phase. |
padding-right |
No | Fully animatable | Space reserved for the right edge of the padding during the layout phase. |
padding-top |
No | Fully animatable | Space reserved for the top edge of the padding during the layout phase. |
position |
No | Discrete | Element’s positioning in its parent container. |
right |
No | Fully animatable | Right distance from the element’s box during layout. |
rotate |
No | Fully animatable | A rotation transformation. |
scale |
No | Fully animatable | A scaling transformation. |
text-overflow |
No | Discrete | The element’s text overflow mode. |
text-shadow |
Yes | Fully animatable | Drop shadow of the text. |
top |
No | Fully animatable | Top distance from the element’s box during layout. |
transform-origin |
No | Fully animatable | The transformation origin is the point around which a transformation is applied. |
transition |
No | Non-animatable | Shorthand for transition-delay, transition-duration, transition-property, transition-timing-function |
transition-delay |
No | Non-animatable | Duration to wait before starting a property’s transition effect when its value changes. |
transition-duration |
No | Non-animatable | Time a transition animation should take to complete. |
transition-property |
No | Non-animatable | Properties to which a transition effect should be applied. |
transition-timing-function |
No | Non-animatable | Determines how intermediate values are calculated for properties modified by a transition effect. |
translate |
No | Fully animatable | A translate transformation. |
-unity-background-image-tint-color |
No | Fully animatable | Tinting color for the element’s backgroundImage. |
-unity-background-scale-mode |
No | Discrete | Background image scaling in the element’s box. |
-unity-editor-text-rendering-mode |
Yes | Non-animatable | TextElement editor rendering mode. |
-unity-font |
Yes | Discrete | Font to draw the element’s text, defined as a Font object. |
-unity-font-definition |
Yes | Discrete | Font to draw the element’s text, defined as a FontDefinition structure. It takes precedence over -unity-font . |
-unity-font-style |
Yes | Discrete | Font style and weight (normal, bold, italic) to draw the element’s text. |
-unity-overflow-clip-box |
No | Discrete | Specifies which box the element content is clipped against. |
-unity-paragraph-spacing |
Yes | Fully animatable | Increases or decreases the space between paragraphs. |
-unity-slice-bottom |
No | Fully animatable | Size of the 9-slice’s bottom edge when painting an element’s background image. |
-unity-slice-left |
No | Fully animatable | Size of the 9-slice’s left edge when painting an element’s background image. |
-unity-slice-right |
No | Fully animatable | Size of the 9-slice’s right edge when painting an element’s background image. |
-unity-slice-scale |
No | Fully animatable | Scale applied to an element’s slices. |
-unity-slice-top |
No | Fully animatable | Size of the 9-slice’s top edge when painting an element’s background image. |
-unity-text-align |
Yes | Discrete | Horizontal and vertical text alignment in the element’s box. |
-unity-text-generator |
Yes | Non-animatable | Switches between Unity’s standard and advanced text generator |
-unity-text-outline |
No | Fully animatable | Outline width and color of the text. |
-unity-text-outline-color |
Yes | Fully animatable | Outline color of the text. |
-unity-text-outline-width |
Yes | Fully animatable | Outline width of the text. |
-unity-text-overflow-position |
No | Discrete | The element’s text overflow position. |
visibility |
Yes | Discrete | Specifies whether or not an element is visible. |
white-space |
Yes | Discrete | Word wrap over multiple lines if not enough space is available to draw the text of an element. |
width |
No | Fully animatable | Fixed width of an element for the layout. |
word-spacing |
Yes | Fully animatable | Increases or decreases the space between words. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.