mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Add docstring comment to Style to reference CSS (#2936)
Mention the fact that the UI layout system is based on the CSS layout model through a docstring comment on the `Style` type. # Objective Explain to new users that the Bevy UI uses the CSS layout model, to lower the barrier to entry given the fact documentation (book and code) is fairly limited on the topic. ## Solution Fix as discussed with @alice-i-cecile on #2918.
This commit is contained in:
parent
aac09353fd
commit
a5c675f336
1 changed files with 8 additions and 0 deletions
|
@ -57,6 +57,14 @@ impl AddAssign<f32> for Val {
|
|||
}
|
||||
}
|
||||
|
||||
/// UI node style.
|
||||
///
|
||||
/// The UI layout system follows the CSS layout model specification (see
|
||||
/// [this section](https://www.w3.org/TR/CSS2/visuren.html) in particular).
|
||||
/// One notable difference however is that the vertical axis is inverted,
|
||||
/// with the Y axis pointing up in Bevy (origin in bottom left corner).
|
||||
///
|
||||
/// You may find [this flexbox guide](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) helpful.
|
||||
#[derive(Component, Clone, PartialEq, Debug, Reflect)]
|
||||
#[reflect(Component, PartialEq)]
|
||||
pub struct Style {
|
||||
|
|
Loading…
Reference in a new issue