Styled widgets (StyledText, StyledIcon...) don't work like Box widgets #319
Closed
Maksimka101
started this conversation in
General
Replies: 2 comments
|
@Maksimka101 Thanks for the feedback; we have a work-in-progress PR to allow modifiers per Spec. Regarding your question, the plan is to try to have a 1-to-1 mapping of the utilities. I believe FlexBox is the only exception to this. If you have a $box and $text in the same style, you can pass them to the widget Box and StyledText, and their attributes will be resolved. However, StyledText and StyledIcon inherit $text and $icon attributes passed straight to Box. |
0 replies
|
Recently, we merged a PR (#517) that introduced a utility specific for $flexBox.chain
..alignment.center()
..padding(10)
..margin(10)
..flex.mainAxisAlignment.center()
..crossAxisAlignment.center() |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
It seems strange to me that the
StyledTextandFlexBoxwidgets acceptStyle, but onlyFlexBoxprocesses$boxattributes, whileStyledTextquietly ignores them. Firstly, it's very unpleasant to pass an attribute that isn't applied. Secondly, it's inconvenient that to create a decorator forRow, you can useHBox, but to create a decorator forText, you need to useBox + StyledText. And in general, it's strange that modifiers apply to everything, context variants also always work, but$boxworks almost always. Why not follow the idea through and createTextBox,ImageBox, andIconBoxso that the$boxattribute always works?And secondly, most importantly, I did not notice any mention in the documentation that
Styledwidgets do not work with the$boxattributeSo, my question is: should absolutely any widget from the mix package support the
$boxattribute?All reactions