Namespace NinjaTools.FlexBuilder.CSS3
Classes
BoxLength
A C# typedef to make sure that CSS Box sizes are never passed to/from methods that use CSS ContentBox or CSS MarginBox sizes etc (and vice versa).
Note that we happily down-convert this to a float automatically (so it can be used anywhere a float is required, including: all Unity core APIs) but we never up-convert from a float (so that you can't naively pass a float into a method that was strongly-typed to require an actual BoxLength instance)
ContentLength
A C# typedef to make sure that CSS ContentBox sizes are never passed to/from methods that use CSS BorderBox or CSS MarginBox sizes (and vice versa).
Note that we happily down-convert this to a float automatically (so it can be used anywhere a float is required, including: all Unity core APIs) but we never up-convert from a float (so that you can't naively pass a float into a method that was strongly-typed to require an actual ContentLength instance)
CSSConstrainedDimensions
Exists to make it easier to pass a pair of constraints (one for width, one for height) as arguments to methods, and then for method bodies to easily extract a specific constraint by Axis
CSSLengthTypeAlgebra
CSS has an over-complex set of mutually-defined concepts that no-one would have invented if they had been thinking before implementing, but this is what we're stuck with historically
FlexboxBasis
Wraps a FlexBasis (which could be dimensionless, e.g. 'CONTENT', or could require a dimension, e.g. 'LENGTH') and a potentially-null float (for the cases of PERCENT and LENGTH) into a single variable.
MarginLength
A C# typedef to make sure that CSS PaddingBox sizes are never passed to/from methods that use CSS ContentBox or CSS MarginBox sizes etc (and vice versa).
Note that we happily down-convert this to a float automatically (so it can be used anywhere a float is required, including: all Unity core APIs) but we never up-convert from a float (so that you can't naively pass a float into a method that was strongly-typed to require an actual MarginLength instance)
MarginValue
A C# typedef to make sure that CSS PaddingBox sizes are never passed to/from methods that use CSS ContentBox or CSS MarginBox sizes etc (and vice versa).
Note that we happily down-convert this to a float automatically (so it can be used anywhere a float is required, including: all Unity core APIs) but we never up-convert from a float (so that you can't naively pass a float into a method that was strongly-typed to require an actual MarginValue instance)
PaddingLength
A C# typedef to make sure that CSS PaddingBox sizes are never passed to/from methods that use CSS ContentBox or CSS MarginBox sizes etc (and vice versa).
Note that we happily down-convert this to a float automatically (so it can be used anywhere a float is required, including: all Unity core APIs) but we never up-convert from a float (so that you can't naively pass a float into a method that was strongly-typed to require an actual PaddingLength instance)
PaddingValue
A C# typedef that stores the "padding part" of a PaddingLength
Structs
Length
CSS3 has multiple possible 'modes' for a Length, the two most common being: PIXELS (px) and PERCENT (%); this wraps the mode with a float value, giving you e.g. "10 px", or eg "50 %".
LengthOrAuto
Margins, Widths, and Heights use a modified version of Length that has the extra option of 'AUTO', maintaining type safety and ensuring e.g. widths dont get mis-used as max-widths. Otherwise this is identical to Length
LengthOrNone
maxwidth / maxheight are specified in an extended form of Length which has the extra (default) value of "NONE" - i.e no maximum. This extends Length to add that option while maintaining typesafety
Margins
Value-type, never shared between different FlexItems
NOTE: this was a side-effect-free class up until v4.0.x added a fully automatic 'detect changes to any data, and automatically relayout, always 100% correctly' feature; that feature forces the sub-properties of this class to need to delegate to informing the owning FlexItem "I changed; trigger a relayout!"
Padding
Value-type, never shared between different FlexItems. Differs from CSS3Margins only in that it has no 'AUTO' optional value
NOTE: this was a side-effect-free class up until v4.0.x added a fully automatic 'detect changes to any data, and automatically relayout, always 100% correctly' feature; that feature forces the sub-properties of this class to need to delegate to informing the owning FlexItem "I changed; trigger a relayout!"
Enums
AlignContent
CSS3 Specification: https://www.w3.org/TR/css-flexbox-1/#align-content-property
AlignItems
CSS3 Specification: https://www.w3.org/TR/css-flexbox-1/#align-items-property
AlignSelf
CSS3 Specification: https://www.w3.org/TR/css-flexbox-1/#align-items-property
BoxSizing
CSS3 Specification: https://www.w3.org/TR/css-sizing-3/#box-sizing
FlexBasis
CSS3 Specification: https://www.w3.org/TR/css-flexbox-1/#flex-basis-property
FlexDirection
CSS3 Specification: https://www.w3.org/TR/css-flexbox-1/#flex-direction-property
FlexJustify
CSS3 Specification: https://www.w3.org/TR/css-flexbox-1/#justify-content-property
FlexWrap
CSS3 Specification: https://www.w3.org/TR/css-flexbox-1/#flex-wrap-property
LengthOrAutoType
CSS lengths can be many different units, this enum tracks which units a length is currently stored in.
Adds 'AUTO' to the LengthType enum
LengthOrNoneType
CSS lengths can be many different units, this enum tracks which units a length is currently stored in.
Adds 'NONE' to the LengthType enum
LengthType
CSS lengths can be many different units, this enum tracks which units a length is currently stored in.
NB: min-height and max-height ... both have incompatible datatypes hidden in the CSS spec, such that they are unique, see: https://www.w3.org/TR/CSS2/visudet.html#propdef-min-width