@@ -216,44 +216,50 @@ pub struct Style {
216
216
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio>
217
217
pub aspect_ratio : Option < f32 > ,
218
218
219
- /// - For Flexbox containers, sets default cross-axis alignment of the child items.
219
+ /// Used to control how each individual item is aligned by default within the space they're given.
220
+ /// - For Flexbox containers, sets default cross axis alignment of the child items.
220
221
/// - For CSS Grid containers, controls block (vertical) axis alignment of children of this grid container within their grid areas.
221
222
///
222
223
/// This value is overridden if [`AlignSelf`] on the child node is set.
223
224
///
224
225
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/align-items>
225
226
pub align_items : AlignItems ,
226
227
227
- /// - For Flexbox containers, this property has no effect. See `justify_content` for main-axis alignment of flex items.
228
+ /// Used to control how each individual item is aligned by default within the space they're given.
229
+ /// - For Flexbox containers, this property has no effect. See `justify_content` for main axis alignment of flex items.
228
230
/// - For CSS Grid containers, sets default inline (horizontal) axis alignment of child items within their grid areas.
229
231
///
230
232
/// This value is overridden if [`JustifySelf`] on the child node is set.
231
233
///
232
234
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items>
233
235
pub justify_items : JustifyItems ,
234
236
235
- /// - For Flexbox items, controls cross-axis alignment of the item.
237
+ /// Used to control how the specified item is aligned within the space it's given.
238
+ /// - For Flexbox items, controls cross axis alignment of the item.
236
239
/// - For CSS Grid items, controls block (vertical) axis alignment of a grid item within its grid area.
237
240
///
238
241
/// If set to `Auto`, alignment is inherited from the value of [`AlignItems`] set on the parent node.
239
242
///
240
243
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/align-self>
241
244
pub align_self : AlignSelf ,
242
245
243
- /// - For Flexbox items, this property has no effect. See `justify_content` for main-axis alignment of flex items.
246
+ /// Used to control how the specified item is aligned within the space it's given.
247
+ /// - For Flexbox items, this property has no effect. See `justify_content` for main axis alignment of flex items.
244
248
/// - For CSS Grid items, controls inline (horizontal) axis alignment of a grid item within its grid area.
245
249
///
246
250
/// If set to `Auto`, alignment is inherited from the value of [`JustifyItems`] set on the parent node.
247
251
///
248
252
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self>
249
253
pub justify_self : JustifySelf ,
250
254
251
- /// - For Flexbox containers, controls alignment of lines if flex_wrap is set to [`FlexWrap::Wrap`] and there are multiple lines of items.
255
+ /// Used to control how items are distributed.
256
+ /// - For Flexbox containers, controls alignment of lines if `flex_wrap` is set to [`FlexWrap::Wrap`] and there are multiple lines of items.
252
257
/// - For CSS Grid containers, controls alignment of grid rows.
253
258
///
254
259
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/align-content>
255
260
pub align_content : AlignContent ,
256
261
262
+ /// Used to control how items are distributed.
257
263
/// - For Flexbox containers, controls alignment of items in the main axis.
258
264
/// - For CSS Grid containers, controls alignment of grid columns.
259
265
///
@@ -443,27 +449,31 @@ impl Default for Style {
443
449
}
444
450
}
445
451
446
- /// How items are aligned according to the cross axis
452
+ /// Used to control how each individual item is aligned by default within the space they're given.
453
+ /// - For Flexbox containers, sets default cross axis alignment of the child items.
454
+ /// - For CSS Grid containers, controls block (vertical) axis alignment of children of this grid container within their grid areas.
455
+ ///
456
+ /// <https://developer.mozilla.org/en-US/docs/Web/CSS/align-items>
447
457
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Serialize , Deserialize , Reflect ) ]
448
458
#[ reflect( PartialEq , Serialize , Deserialize ) ]
449
459
pub enum AlignItems {
450
460
/// The items are packed in their default position as if no alignment was applied.
451
461
Default ,
452
- /// Items are packed towards the start of the axis.
462
+ /// The items are packed towards the start of the axis.
453
463
Start ,
454
- /// Items are packed towards the end of the axis.
464
+ /// The items are packed towards the end of the axis.
455
465
End ,
456
- /// Items are packed towards the start of the axis, unless the flex direction is reversed;
466
+ /// The items are packed towards the start of the axis, unless the flex direction is reversed;
457
467
/// then they are packed towards the end of the axis.
458
468
FlexStart ,
459
- /// Items are packed towards the end of the axis, unless the flex direction is reversed;
469
+ /// The items are packed towards the end of the axis, unless the flex direction is reversed;
460
470
/// then they are packed towards the start of the axis.
461
471
FlexEnd ,
462
- /// Items are aligned at the center.
472
+ /// The items are packed along the center of the axis .
463
473
Center ,
464
- /// Items are aligned at the baseline .
474
+ /// The items are packed such that their baselines align .
465
475
Baseline ,
466
- /// Items are stretched across the whole cross axis .
476
+ /// The items are stretched to fill the space they're given .
467
477
Stretch ,
468
478
}
469
479
@@ -477,21 +487,25 @@ impl Default for AlignItems {
477
487
}
478
488
}
479
489
480
- /// How items are aligned according to the main axis
490
+ /// Used to control how each individual item is aligned by default within the space they're given.
491
+ /// - For Flexbox containers, this property has no effect. See `justify_content` for main axis alignment of flex items.
492
+ /// - For CSS Grid containers, sets default inline (horizontal) axis alignment of child items within their grid areas.
493
+ ///
494
+ /// <https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items>
481
495
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Serialize , Deserialize , Reflect ) ]
482
496
#[ reflect( PartialEq , Serialize , Deserialize ) ]
483
497
pub enum JustifyItems {
484
498
/// The items are packed in their default position as if no alignment was applied.
485
499
Default ,
486
- /// Items are packed towards the start of the axis.
500
+ /// The items are packed towards the start of the axis.
487
501
Start ,
488
- /// Items are packed towards the end of the axis.
502
+ /// The items are packed towards the end of the axis.
489
503
End ,
490
- /// Items are aligned at the center.
504
+ /// The items are packed along the center of the axis
491
505
Center ,
492
- /// Items are aligned at the baseline .
506
+ /// The items are packed such that their baselines align .
493
507
Baseline ,
494
- /// Items are stretched across the whole main axis .
508
+ /// The items are stretched to fill the space they're given .
495
509
Stretch ,
496
510
}
497
511
@@ -505,8 +519,11 @@ impl Default for JustifyItems {
505
519
}
506
520
}
507
521
508
- /// How this item is aligned according to the cross axis.
509
- /// Overrides [`AlignItems`].
522
+ /// Used to control how the specified item is aligned within the space it's given.
523
+ /// - For Flexbox items, controls cross axis alignment of the item.
524
+ /// - For CSS Grid items, controls block (vertical) axis alignment of a grid item within its grid area.
525
+ ///
526
+ /// <https://developer.mozilla.org/en-US/docs/Web/CSS/align-self>
510
527
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Serialize , Deserialize , Reflect ) ]
511
528
#[ reflect( PartialEq , Serialize , Deserialize ) ]
512
529
pub enum AlignSelf {
@@ -522,11 +539,11 @@ pub enum AlignSelf {
522
539
/// This item will be aligned with the end of the axis, unless the flex direction is reversed;
523
540
/// then it will be aligned with the start of the axis.
524
541
FlexEnd ,
525
- /// This item will be aligned at the center.
542
+ /// This item will be aligned along the center of the axis .
526
543
Center ,
527
544
/// This item will be aligned at the baseline.
528
545
Baseline ,
529
- /// This item will be stretched across the whole cross axis .
546
+ /// This item will be stretched to fill the container .
530
547
Stretch ,
531
548
}
532
549
@@ -540,8 +557,11 @@ impl Default for AlignSelf {
540
557
}
541
558
}
542
559
543
- /// How this item is aligned according to the main axis.
544
- /// Overrides [`JustifyItems`].
560
+ /// Used to control how the specified item is aligned within the space it's given.
561
+ /// - For Flexbox items, this property has no effect. See `justify_content` for main axis alignment of flex items.
562
+ /// - For CSS Grid items, controls inline (horizontal) axis alignment of a grid item within its grid area.
563
+ ///
564
+ /// <https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self>
545
565
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Serialize , Deserialize , Reflect ) ]
546
566
#[ reflect( PartialEq , Serialize , Deserialize ) ]
547
567
pub enum JustifySelf {
@@ -551,11 +571,11 @@ pub enum JustifySelf {
551
571
Start ,
552
572
/// This item will be aligned with the end of the axis.
553
573
End ,
554
- /// This item will be aligned at the center.
574
+ /// This item will be aligned along the center of the axis .
555
575
Center ,
556
576
/// This item will be aligned at the baseline.
557
577
Baseline ,
558
- /// This item will be stretched across the whole main axis .
578
+ /// This item will be stretched to fill the space it's given .
559
579
Stretch ,
560
580
}
561
581
@@ -569,34 +589,35 @@ impl Default for JustifySelf {
569
589
}
570
590
}
571
591
572
- /// Defines how each line is aligned within the flexbox.
592
+ /// Used to control how items are distributed.
593
+ /// - For Flexbox containers, controls alignment of lines if `flex_wrap` is set to [`FlexWrap::Wrap`] and there are multiple lines of items.
594
+ /// - For CSS Grid containers, controls alignment of grid rows.
573
595
///
574
- /// It only applies if [`FlexWrap::Wrap`] is present and if there are multiple lines of items.
596
+ /// <https://developer.mozilla.org/en-US/docs/Web/CSS/align-content>
575
597
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Serialize , Deserialize , Reflect ) ]
576
598
#[ reflect( PartialEq , Serialize , Deserialize ) ]
577
599
pub enum AlignContent {
578
600
/// The items are packed in their default position as if no alignment was applied.
579
601
Default ,
580
- /// Each line moves towards the start of the cross axis.
602
+ /// The items are packed towards the start of the axis.
581
603
Start ,
582
- /// Each line moves towards the end of the cross axis.
604
+ /// The items are packed towards the end of the axis.
583
605
End ,
584
- /// Each line moves towards the start of the cross axis, unless the flex direction is reversed; then the line moves towards the end of the cross axis.
606
+ /// The items are packed towards the start of the axis, unless the flex direction is reversed;
607
+ /// then the items are packed towards the end of the axis.
585
608
FlexStart ,
586
- /// Each line moves towards the end of the cross axis, unless the flex direction is reversed; then the line moves towards the start of the cross axis.
609
+ /// The items are packed towards the end of the axis, unless the flex direction is reversed;
610
+ /// then the items are packed towards the start of the axis.
587
611
FlexEnd ,
588
- /// Each line moves towards the center of the cross axis.
612
+ /// The items are packed along the center of the axis.
589
613
Center ,
590
- /// Each line will stretch to fill the remaining space .
614
+ /// The items are stretched to fill the container along the axis .
591
615
Stretch ,
592
- /// Each line fills the space it needs, putting the remaining space, if any,
593
- /// between the lines.
616
+ /// The items are distributed such that the gap between any two items is equal.
594
617
SpaceBetween ,
595
- /// The gap between the first and last items is exactly the same as the gap between items.
596
- /// The gaps are distributed evenly.
618
+ /// The items are distributed such that the gap between and around any two items is equal.
597
619
SpaceEvenly ,
598
- /// Each line fills the space it needs, putting the remaining space, if any,
599
- /// around the lines.
620
+ /// The items are distributed such that the gap between and around any two items is equal, with half-size gaps on either end.
600
621
SpaceAround ,
601
622
}
602
623
@@ -610,28 +631,36 @@ impl Default for AlignContent {
610
631
}
611
632
}
612
633
613
- /// Defines how items are aligned according to the main axis
634
+ /// Used to control how items are distributed.
635
+ /// - For Flexbox containers, controls alignment of items in the main axis.
636
+ /// - For CSS Grid containers, controls alignment of grid columns.
637
+ ///
638
+ /// <https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content>
614
639
#[ derive( Copy , Clone , PartialEq , Eq , Debug , Serialize , Deserialize , Reflect ) ]
615
640
#[ reflect( PartialEq , Serialize , Deserialize ) ]
616
641
pub enum JustifyContent {
617
642
/// The items are packed in their default position as if no alignment was applied.
618
643
Default ,
619
- /// Items are packed toward the start of the axis.
644
+ /// The items are packed towards the start of the axis.
620
645
Start ,
621
- /// Items are packed toward the end of the axis.
646
+ /// The items are packed towards the end of the axis.
622
647
End ,
623
- /// Pushed towards the start, unless the flex direction is reversed; then pushed towards the end.
648
+ /// The items are packed towards the start of the axis, unless the flex direction is reversed;
649
+ /// then the items are packed towards the end of the axis.
624
650
FlexStart ,
625
- /// Pushed towards the end, unless the flex direction is reversed; then pushed towards the start.
651
+ /// The items are packed towards the end of the axis, unless the flex direction is reversed;
652
+ /// then the items are packed towards the start of the axis.
626
653
FlexEnd ,
627
- /// Centered along the main axis.
654
+ /// The items are packed along the center of the axis.
628
655
Center ,
629
- /// Remaining space is distributed between the items.
656
+ /// The items are stretched to fill the container along the axis.
657
+ Stretch ,
658
+ /// The items are distributed such that the gap between any two items is equal.
630
659
SpaceBetween ,
631
- /// Remaining space is distributed around the items.
632
- SpaceAround ,
633
- /// Like [`JustifyContent::SpaceAround`] but with even spacing between items.
660
+ /// The items are distributed such that the gap between and around any two items is equal.
634
661
SpaceEvenly ,
662
+ /// The items are distributed such that the gap between and around any two items is equal, with half-size gaps on either end.
663
+ SpaceAround ,
635
664
}
636
665
637
666
impl JustifyContent {
0 commit comments