The Em
field in the Sandbox.UI.LengthUnit
enumeration represents the font size of the current element. It is a relative unit that scales according to the font size of the element it is applied to, making it useful for responsive design.
The Em
field in the Sandbox.UI.LengthUnit
enumeration represents the font size of the current element. It is a relative unit that scales according to the font size of the element it is applied to, making it useful for responsive design.
Use LengthUnit.Em
when you want to specify a length that is relative to the font size of the current element. This is particularly useful for creating scalable and responsive UI components where the size of elements should adjust based on the font size.
// Example of using LengthUnit.Em in a UI component var length = new Length(2, LengthUnit.Em); // This sets the length to be twice the font size of the current element var style = new Style(); style.Set("margin", length);