Skip to content

Refactor Node fields (previously Style) #10497

@viridia

Description

@viridia

What problem does this solve or what need does it fill?

Bevy uses the word "Style" to represent a set of styles that can be applied to a NodeBundle. Unfortunately, the name is rather broad, which causes problems for a number of reasons:

  • Not all style properties are represented in Style, so the name is misleading.
  • Style only applies to NodeBundles, not other kinds of entities (such as Text) which might also need styles.
  • Many UI frameworks which want to define a more comprehensive, all-encompassing "style" structure are forced to pick a different name, despite the fact that the word "Style" is a natural fit for such a struct. (Yes, you can use namespace qualification, but that leads to a different kind of ugliness).

What solution would you like?

I propose renaming "Style" to something more specific such as "NodeStyle". We can keep a type alias "Style" for backwards compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions