Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IStyle

This interface provides access to a VisualElement inline style data.
Read time 5 minutesLast updated 2 days ago

Definition

public interface IStyle

Remarks

Reading properties from this object will read from the inline style data for this element. To read the style data computed for the element use IComputedStyle interface. Writing to a property will mask the value coming from USS with the provided value however other properties will still match the values from USS.

Properties

Property

Description

alignContentAlignment of the whole area of children on the cross axis if they span over multiple lines in this container.
alignItemsAlignment of children on the cross axis of this container.
alignSelfSimilar to align-items, but only for this specific element.
backgroundColorBackground color to paint in the element's box.
backgroundImageBackground image to paint in the element's box.
backgroundPositionXBackground image x position value.
backgroundPositionYBackground image y position value.
backgroundRepeatBackground image repeat value.
backgroundSizeBackground image size value. Transitions are fully supported only when using size in pixels or percentages, such as pixel-to-pixel or percentage-to-percentage transitions.
borderBottomColorColor of the element's bottom border.
borderBottomLeftRadiusThe radius of the bottom-left corner when a rounded rectangle is drawn in the element's box.
borderBottomRightRadiusThe radius of the bottom-right corner when a rounded rectangle is drawn in the element's box.
borderBottomWidthSpace reserved for the bottom edge of the border during the layout phase.
borderLeftColorColor of the element's left border.
borderLeftWidthSpace reserved for the left edge of the border during the layout phase.
borderRightColorColor of the element's right border.
borderRightWidthSpace reserved for the right edge of the border during the layout phase.
borderTopColorColor of the element's top border.
borderTopLeftRadiusThe radius of the top-left corner when a rounded rectangle is drawn in the element's box.
borderTopRightRadiusThe radius of the top-right corner when a rounded rectangle is drawn in the element's box.
borderTopWidthSpace reserved for the top edge of the border during the layout phase.
bottomBottom distance from the element's box during layout.
colorColor to use when drawing the text of an element.
cursorMouse cursor to display when the mouse pointer is over an element.
displayDefines how an element is displayed in the layout.
flexBasisInitial 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.
flexDirectionDirection of the main axis to layout children in a container.
flexGrowSpecifies how the item will grow relative to the rest of the flexible items inside the same container.
flexShrinkSpecifies how the item will shrink relative to the rest of the flexible items inside the same container.
flexWrapPlacement of children over multiple lines if not enough space is available in this container.
fontSizeFont size to draw the element's text, specified in point size.
heightFixed height of an element for the layout.
justifyContentJustification of children on the main axis of this container.
leftLeft distance from the element's box during layout.
letterSpacingIncreases or decreases the space between characters.
marginBottomSpace reserved for the bottom edge of the margin during the layout phase.
marginLeftSpace reserved for the left edge of the margin during the layout phase.
marginRightSpace reserved for the right edge of the margin during the layout phase.
marginTopSpace reserved for the top edge of the margin during the layout phase.
maxHeightMaximum height for an element, when it is flexible or measures its own size.
maxWidthMaximum width for an element, when it is flexible or measures its own size.
minHeightMinimum height for an element, when it is flexible or measures its own size.
minWidthMinimum width for an element, when it is flexible or measures its own size.
opacitySpecifies the transparency of an element and of its children.
overflowHow a container behaves if its content overflows its own box.
paddingBottomSpace reserved for the bottom edge of the padding during the layout phase.
paddingLeftSpace reserved for the left edge of the padding during the layout phase.
paddingRightSpace reserved for the right edge of the padding during the layout phase.
paddingTopSpace reserved for the top edge of the padding during the layout phase.
positionElement's positioning in its parent container.
rightRight distance from the element's box during layout.
rotateA rotation transformation.
scaleA scaling transformation.
textOverflowThe element's text overflow mode.
textShadowDrop shadow of the text.
topTop distance from the element's box during layout.
transformOriginThe transformation origin is the point around which a transformation is applied.
transitionDelayDuration to wait before starting a property's transition effect when its value changes.
transitionDurationTime a transition animation should take to complete.
transitionPropertyProperties to which a transition effect should be applied.
transitionTimingFunctionDetermines how intermediate values are calculated for properties modified by a transition effect.
translateA translate transformation.
unityBackgroundImageTintColorTinting color for the element's backgroundImage.
unityEditorTextRenderingModeTextElement editor rendering mode.
unityFontFont to draw the element's text, defined as a Font object.
unityFontDefinitionFont to draw the element's text, defined as a FontDefinition structure. It takes precedence over
-unity-font
.
unityFontStyleAndWeightFont style and weight (normal, bold, italic) to draw the element's text.
unityOverflowClipBoxSpecifies which box the element content is clipped against.
unityParagraphSpacingIncreases or decreases the space between paragraphs.
unitySliceBottomSize of the 9-slice's bottom edge when painting an element's background image.
unitySliceLeftSize of the 9-slice's left edge when painting an element's background image.
unitySliceRightSize of the 9-slice's right edge when painting an element's background image.
unitySliceScaleScale applied to an element's slices.
unitySliceTopSize of the 9-slice's top edge when painting an element's background image.
unitySliceTypeSpecifies the type of sclicing.
unityTextAlignHorizontal and vertical text alignment in the element's box.
unityTextGeneratorSwitches between Unity's standard and advanced text generator
unityTextOutlineColorOutline color of the text.
unityTextOutlineWidthOutline width of the text.
unityTextOverflowPositionThe element's text overflow position.
visibilitySpecifies whether or not an element is visible.
whiteSpaceWord wrap over multiple lines if not enough space is available to draw the text of an element.
widthFixed width of an element for the layout.
wordSpacingIncreases or decreases the space between words.