-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split UI Style
into multiple components
#5511
Comments
I would suggest spending some time in component design, instead of blindly convert each field into a component. |
Strongly in favor; I think this would help make accessing and defining this information much easier. Some bikeshedding:
Archetype invariants is definitely the right tool to ensure cohesion. It should be ready soon. |
Proposed split:
|
Not sure if in-topic, but I think it would be good UX to have font weight/style and text decoration as their own components:
|
Definitely agree, but for now we should just split the layout-relevant bits. |
What problem does this solve or what need does it fill?
Style
component is rather monolithic could benefit from being split into multiple components.I want to gather some feedback on the validity / usefulness of doing so before we'll mark this as "ready-for-implementation" or close it out if it turns out to not be a good idea.
This is what it looks like today:
What solution would you like?
Style
component into the following:DisplayComponent
PositionTypeComponent
DirectionComponent
FlexDirectionComponent
FlexWrapComponent
AlignItemsComponent
AlignSelfComponent
AlignContentComponent
JustifyContentComponent
PositionComponent
MarginComponent
PaddingComponent
BorderComponent
FlexGrowComponent
FlexShrinkComponent
FlexBasisComponent
SizeComponent
MinSizeComponent
MaxSizeComponent
AspectRatioComponent
OverflowComponent
UiStyleQuery
that queries for all of these componentsUiStyleBundle
containing all of these componentsUiStyleBundle
to theUiNodeBundle
ssixfold
on discord mentioned that these components should all share the sameStyle
-trait which would be a marker trait to start with but could be extended going forwardOpen to suggestions on naming, I'm not sure how useful calling them
FooComponent
when they also#[derive(Component)]
If some of these components are always used together, it might make sense to merge them instead of having everything be separate.
What alternative(s) have you considered?
Leave
Style
as is.We are going to need more ergonomic ways of interacting with UI overall, this addresses a tiny part of it but there could be other designs that makes more sense.
Additional context
Window
struct into multiple separate componentsEntities
#4947The text was updated successfully, but these errors were encountered: