Class CSSHelpers
Methods that are frequently needed to help implement common CSS3 features - TODO: this may get merged into one of
the ILayoutAlgorithm-base-classes in future
Assembly: cs.temp.dll.dll
public static class CSSHelpers
Methods
- (Single)
ContentSizeForBoxSize(FlexItem, Axis, Single)
note: do not pass this a ContentLength, compiler cannot warn you if you make that mistake
Parameters
Returns
RFC's aren't allowed FlexItem's, so all their Box/Content/Outer/Inner/Padding/Margins values are - by definition - the same
Parameters
Returns
- (Single)
ConvertBoxLengthToOuterLength(FlexItem, Axis, Single, ContentLength, Boolean)
Spec: https://www.w3.org/TR/css-sizing-3/#outer-size
Outer Size === "content_box + padding + border + margins" -- i.e. the outermost variant of a CSS Box
Note: Requires that the size passed in is the 'box' size, which depends on the element's boxmode (CONTENT_BOX
vs BORDER_BOX etc)
Parameters
Returns
- (BoxLength)
ConvertOuterLengthToBoxLength(FlexItem, Axis, Single, ContentLength)
Note: "outer" length is the same as "margin-box" length by definition
Parameters
FlexItem |
item |
|
Axis |
axis |
|
Single |
outerLength |
|
ContentLength |
effectiveContainerInnerSize |
|
Returns
Exceptions
- (ContentLength)
ConvertOuterLengthToInnerLength(FlexItem, Axis, Single, ContentLength)
Note: "inner" length is the same as "content" length by definition,
Note: "outer" length is the same as "margin-box" length by definition
i.e. this ALWAYS subtracts BOTH the padding AND the margins
Parameters
FlexItem |
item |
|
Axis |
axis |
|
Single |
outerLength |
|
ContentLength |
effectiveContainerInnerSize |
|
Returns
Exceptions
- (Axis)
CrossFromMain(Axis)
- (Axis)
MainAxis(FlexDirection)
- (Axis)
MainFromCross(Axis)