public interface CustomStyle<in ScopeT : CustomStyleScope>
A base type for custom styles including CommonStyle. A design system is expected to have multiple style types that each derive from CustomStyle, one that is used by most components in the system, and a set of component specific style types. These types allow the style types to only surface the properties, states, and subcomponents a design system, and its components, supports. These members are accessed through the CustomStyleScope, the class passed as the ScopeT parameter, that is created at the same time. The CustomStyleScope has custom extension functions (such a background, minSize, etc.) that set the design system defined StyleProperty.
To be resolved by a StyleResolver, a CustomStyle must be converted to a CommonStyle first. A CustomStyle is expected to implement a toCommonStyle() extension function that implements a boilerplate conversion. See the sample for an example of how this is done.
Functions
applyStyle
public fun ScopeT.applyStyle()
The single abstract method used to invoke the lambda. The lambda has ScopeT as its receiver (i.e.this) type.