This property is used to get and set the unit for the style variant. The valid unit values:
- 0 = Null
- 1 = Unknown
- 2 = Auto
- 3 = None
- 4 = Default
- 5 = Inherit
- 6 = Keyword
- 7 = String
- 8 = URL
- 9 = Color
- 10 = SysColorString
- 11 = Number
- 12 = Float
- 13 = Percent
- 14 = Pixel
- 15 = Point
- 16 = Em
- 17 = Second
- 18 = Millisecond
- 19 = Rect
- 20 = OSTheme
function onSample()
{
var rootBox = scene.rootBox;
if (rootBox)
{
var styleVar = rootBox.getStyle("top");
if (styleVar)
{
shell.print("unit = " + styleVar.unit);
}
}
}