You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The layout system is pretty good now. The arguments lenghts however are quite lengthy, and the resulting generators aren't very flexible style wise.
The latter is especially true for generators that ar ea collection of multiple elements, in which styling the individual elements beyond the given options is impossible. Example:
field:FieldType-> (String->TrWorkActions.Action) ->String->String->String->TrColor.RgbaColor->TrColor.RgbaColor->TrColor.RgbaColor->TrColor.RgbaColor->Float->Float->TrLayout.Generatorfield fieldType toAction label help value color inputColor inputBackground inputBorder labelSize size ={-| ... -}
As a user of the above given example generator:
It is impossible to style label beyond the text size and color without also affecting the input element
It is quite error prone to give arguments as there are:
Many arguments
No named arguments (as that is not supported in Elm)
Proposed solutions:
A solution to the extensibility is to instead of asking for individual styles such as font size and color, to ask for a Styles argument per individual element. (e.g. that would mean 2 Styles arguments for field, one for the label and one for the actual input element)
A solotuion for the lengthy generator functions would be to put all static arguments in a nice Descriptor type alias and only have the dynamic variables as seperate variables.
This should also make it easier to share such descriptions easier
Extensible records might be of help here, although I'm not entirely sure of this.
The text was updated successfully, but these errors were encountered:
The layout system is pretty good now. The arguments lenghts however are quite lengthy, and the resulting generators aren't very flexible style wise.
The latter is especially true for generators that ar ea collection of multiple elements, in which styling the individual elements beyond the given options is impossible. Example:
As a user of the above given example generator:
Proposed solutions:
Styles
argument per individual element. (e.g. that would mean 2Styles
arguments forfield
, one for the label and one for the actual input element)The text was updated successfully, but these errors were encountered: