public enum StyleUnitThe units a length can carry.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Relative units are carried here, and never resolved here. A value of two em means exactly that and nothing more; turning it into pixels needs a context — the element's own font size, the root's, the surface's — that does not exist at parse time, and that step belongs to Vixen.Ui. Nothing in this assembly is allowed to half-resolve one, because a consumer would then have to ask which half.
⚠ This type used to leave em and friends out entirely, on the argument that they belonged downstream. That was right about resolution and wrong about representation, and transitions are what settled it: the animator interpolates StyleValue, so a unit this type cannot express is a unit that cannot animate. Leaving them out meant width: 2em parsed as Unknown, and a transition on it silently did nothing — no diagnostic, no exception, just a property that snaps while its neighbours ease.
The known limit, which is older than this change: interpolation requires both endpoints to share a unit, so 2em → 40px does not animate. CSS resolves both to pixels at computed-value time and Vixen animates specified values, which was already true of % against px.
Fields and properties (11)
NoneNo unit — a bare number used where a length is expected, which CSS allows only for zero.
PixelsDevice-independent pixels.
PercentA percentage of something the property decides.
SecondsSeconds. Durations and delays.
DegreesDegrees. Angles.
EmThe element's own font size — except on font-size, where it is the parent's.
RemThe root element's font size, however deep the element is.
ViewportWidthA hundredth of the viewport's width.
ViewportHeightA hundredth of the viewport's height.
ViewportMinA hundredth of the viewport's smaller side.
ViewportMaxA hundredth of the viewport's larger side.
Used by (6)
- DrawListBuilderVixen.Ui
- LengthContextVixen.Ui
- StyleValueVixen.Ui.Styling
- StyleValueParserVixen.Ui.Styling
- StyleValueTestsVixen.Ui.Styling.Tests
- UiDocumentVixen.Ui