Description
The FlexShrink
property in the Sandbox.UI.BaseStyles
class represents the flex-shrink
CSS property. This property specifies the flex shrink factor of a flex item. It defines the ability for a flex item to shrink if necessary. It is a float?
type, meaning it can hold a floating-point number or be null.
Usage
To use the FlexShrink
property, assign it a nullable float value that represents the shrink factor. A higher value indicates a greater ability to shrink. If set to null, the default behavior is applied.
Example
// Example of setting the FlexShrink property
var styles = new BaseStyles();
styles.FlexShrink = 1.0f; // Flex item can shrink equally with others
// Resetting to default behavior
styles.FlexShrink = null;