mod alignment;
mod dimension;
#[cfg(feature = "block_layout")]
mod block;
#[cfg(feature = "flexbox")]
mod flex;
#[cfg(feature = "grid")]
mod grid;
pub use self::alignment::{AlignContent, AlignItems, AlignSelf, JustifyContent, JustifyItems, JustifySelf};
pub use self::dimension::{AvailableSpace, Dimension, LengthPercentage, LengthPercentageAuto};
#[cfg(feature = "block_layout")]
pub use self::block::{BlockContainerStyle, BlockItemStyle, TextAlign};
#[cfg(feature = "flexbox")]
pub use self::flex::{FlexDirection, FlexWrap, FlexboxContainerStyle, FlexboxItemStyle};
#[cfg(feature = "grid")]
pub(crate) use self::grid::{GenericGridPlacement, OriginZeroGridPlacement};
#[cfg(feature = "grid")]
pub use self::grid::{
GridAutoFlow, GridContainerStyle, GridItemStyle, GridPlacement, GridTrackRepetition, MaxTrackSizingFunction,
MinTrackSizingFunction, NonRepeatedTrackSizingFunction, TrackSizingFunction,
};
use crate::geometry::{Point, Rect, Size};
#[cfg(feature = "grid")]
use crate::geometry::Line;
#[cfg(feature = "serde")]
use crate::style_helpers;
#[cfg(feature = "grid")]
use crate::util::sys::GridTrackVec;
pub trait CoreStyle {
#[inline(always)]
fn box_generation_mode(&self) -> BoxGenerationMode {
BoxGenerationMode::DEFAULT
}
#[inline(always)]
fn is_block(&self) -> bool {
false
}
#[inline(always)]
fn box_sizing(&self) -> BoxSizing {
BoxSizing::BorderBox
}
#[inline(always)]
fn overflow(&self) -> Point<Overflow> {
Style::DEFAULT.overflow
}
#[inline(always)]
fn scrollbar_width(&self) -> f32 {
0.0
}
#[inline(always)]
fn position(&self) -> Position {
Style::DEFAULT.position
}
#[inline(always)]
fn inset(&self) -> Rect<LengthPercentageAuto> {
Style::DEFAULT.inset
}
#[inline(always)]
fn size(&self) -> Size<Dimension> {
Style::DEFAULT.size
}
#[inline(always)]
fn min_size(&self) -> Size<Dimension> {
Style::DEFAULT.min_size
}
#[inline(always)]
fn max_size(&self) -> Size<Dimension> {
Style::DEFAULT.max_size
}
#[inline(always)]
fn aspect_ratio(&self) -> Option<f32> {
Style::DEFAULT.aspect_ratio
}
#[inline(always)]
fn margin(&self) -> Rect<LengthPercentageAuto> {
Style::DEFAULT.margin
}
#[inline(always)]
fn padding(&self) -> Rect<LengthPercentage> {
Style::DEFAULT.padding
}
#[inline(always)]
fn border(&self) -> Rect<LengthPercentage> {
Style::DEFAULT.border
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Display {
#[cfg(feature = "block_layout")]
Block,
#[cfg(feature = "flexbox")]
Flex,
#[cfg(feature = "grid")]
Grid,
None,
}
impl Display {
#[cfg(feature = "flexbox")]
pub const DEFAULT: Display = Display::Flex;
#[cfg(all(feature = "grid", not(feature = "flexbox")))]
pub const DEFAULT: Display = Display::Grid;
#[cfg(all(feature = "block_layout", not(feature = "flexbox"), not(feature = "grid")))]
pub const DEFAULT: Display = Display::Block;
#[cfg(all(not(feature = "flexbox"), not(feature = "grid"), not(feature = "block_layout")))]
pub const DEFAULT: Display = Display::None;
}
impl Default for Display {
fn default() -> Self {
Self::DEFAULT
}
}
impl core::fmt::Display for Display {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Display::None => write!(f, "NONE"),
#[cfg(feature = "block_layout")]
Display::Block => write!(f, "BLOCK"),
#[cfg(feature = "flexbox")]
Display::Flex => write!(f, "FLEX"),
#[cfg(feature = "grid")]
Display::Grid => write!(f, "GRID"),
}
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum BoxGenerationMode {
Normal,
None,
}
impl BoxGenerationMode {
pub const DEFAULT: BoxGenerationMode = BoxGenerationMode::Normal;
}
impl Default for BoxGenerationMode {
fn default() -> Self {
Self::DEFAULT
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Position {
Relative,
Absolute,
}
impl Default for Position {
fn default() -> Self {
Self::Relative
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum BoxSizing {
BorderBox,
ContentBox,
}
impl Default for BoxSizing {
fn default() -> Self {
Self::BorderBox
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Overflow {
#[default]
Visible,
Clip,
Hidden,
Scroll,
}
impl Overflow {
#[inline(always)]
pub(crate) fn is_scroll_container(self) -> bool {
match self {
Self::Visible | Self::Clip => false,
Self::Hidden | Self::Scroll => true,
}
}
#[inline(always)]
pub(crate) fn maybe_into_automatic_min_size(self) -> Option<f32> {
match self.is_scroll_container() {
true => Some(0.0),
false => None,
}
}
}
#[derive(Clone, PartialEq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(default))]
pub struct Style {
pub display: Display,
pub item_is_table: bool,
pub box_sizing: BoxSizing,
pub overflow: Point<Overflow>,
pub scrollbar_width: f32,
pub position: Position,
#[cfg_attr(feature = "serde", serde(default = "style_helpers::auto"))]
pub inset: Rect<LengthPercentageAuto>,
#[cfg_attr(feature = "serde", serde(default = "style_helpers::auto"))]
pub size: Size<Dimension>,
#[cfg_attr(feature = "serde", serde(default = "style_helpers::auto"))]
pub min_size: Size<Dimension>,
#[cfg_attr(feature = "serde", serde(default = "style_helpers::auto"))]
pub max_size: Size<Dimension>,
pub aspect_ratio: Option<f32>,
#[cfg_attr(feature = "serde", serde(default = "style_helpers::zero"))]
pub margin: Rect<LengthPercentageAuto>,
#[cfg_attr(feature = "serde", serde(default = "style_helpers::zero"))]
pub padding: Rect<LengthPercentage>,
#[cfg_attr(feature = "serde", serde(default = "style_helpers::zero"))]
pub border: Rect<LengthPercentage>,
#[cfg(any(feature = "flexbox", feature = "grid"))]
pub align_items: Option<AlignItems>,
#[cfg(any(feature = "flexbox", feature = "grid"))]
pub align_self: Option<AlignSelf>,
#[cfg(feature = "grid")]
pub justify_items: Option<AlignItems>,
#[cfg(feature = "grid")]
pub justify_self: Option<AlignSelf>,
#[cfg(any(feature = "flexbox", feature = "grid"))]
pub align_content: Option<AlignContent>,
#[cfg(any(feature = "flexbox", feature = "grid"))]
pub justify_content: Option<JustifyContent>,
#[cfg(any(feature = "flexbox", feature = "grid"))]
#[cfg_attr(feature = "serde", serde(default = "style_helpers::zero"))]
pub gap: Size<LengthPercentage>,
#[cfg(feature = "block_layout")]
pub text_align: TextAlign,
#[cfg(feature = "flexbox")]
pub flex_direction: FlexDirection,
#[cfg(feature = "flexbox")]
pub flex_wrap: FlexWrap,
#[cfg(feature = "flexbox")]
pub flex_basis: Dimension,
#[cfg(feature = "flexbox")]
pub flex_grow: f32,
#[cfg(feature = "flexbox")]
pub flex_shrink: f32,
#[cfg(feature = "grid")]
pub grid_template_rows: GridTrackVec<TrackSizingFunction>,
#[cfg(feature = "grid")]
pub grid_template_columns: GridTrackVec<TrackSizingFunction>,
#[cfg(feature = "grid")]
pub grid_auto_rows: GridTrackVec<NonRepeatedTrackSizingFunction>,
#[cfg(feature = "grid")]
pub grid_auto_columns: GridTrackVec<NonRepeatedTrackSizingFunction>,
#[cfg(feature = "grid")]
pub grid_auto_flow: GridAutoFlow,
#[cfg(feature = "grid")]
pub grid_row: Line<GridPlacement>,
#[cfg(feature = "grid")]
pub grid_column: Line<GridPlacement>,
}
impl Style {
pub const DEFAULT: Style = Style {
display: Display::DEFAULT,
item_is_table: false,
box_sizing: BoxSizing::BorderBox,
overflow: Point { x: Overflow::Visible, y: Overflow::Visible },
scrollbar_width: 0.0,
position: Position::Relative,
inset: Rect::auto(),
margin: Rect::zero(),
padding: Rect::zero(),
border: Rect::zero(),
size: Size::auto(),
min_size: Size::auto(),
max_size: Size::auto(),
aspect_ratio: None,
#[cfg(any(feature = "flexbox", feature = "grid"))]
gap: Size::zero(),
#[cfg(any(feature = "flexbox", feature = "grid"))]
align_items: None,
#[cfg(any(feature = "flexbox", feature = "grid"))]
align_self: None,
#[cfg(feature = "grid")]
justify_items: None,
#[cfg(feature = "grid")]
justify_self: None,
#[cfg(any(feature = "flexbox", feature = "grid"))]
align_content: None,
#[cfg(any(feature = "flexbox", feature = "grid"))]
justify_content: None,
#[cfg(feature = "block_layout")]
text_align: TextAlign::Auto,
#[cfg(feature = "flexbox")]
flex_direction: FlexDirection::Row,
#[cfg(feature = "flexbox")]
flex_wrap: FlexWrap::NoWrap,
#[cfg(feature = "flexbox")]
flex_grow: 0.0,
#[cfg(feature = "flexbox")]
flex_shrink: 1.0,
#[cfg(feature = "flexbox")]
flex_basis: Dimension::Auto,
#[cfg(feature = "grid")]
grid_template_rows: GridTrackVec::new(),
#[cfg(feature = "grid")]
grid_template_columns: GridTrackVec::new(),
#[cfg(feature = "grid")]
grid_auto_rows: GridTrackVec::new(),
#[cfg(feature = "grid")]
grid_auto_columns: GridTrackVec::new(),
#[cfg(feature = "grid")]
grid_auto_flow: GridAutoFlow::Row,
#[cfg(feature = "grid")]
grid_row: Line { start: GridPlacement::Auto, end: GridPlacement::Auto },
#[cfg(feature = "grid")]
grid_column: Line { start: GridPlacement::Auto, end: GridPlacement::Auto },
};
}
impl Default for Style {
fn default() -> Self {
Style::DEFAULT
}
}
impl CoreStyle for Style {
#[inline(always)]
fn box_generation_mode(&self) -> BoxGenerationMode {
match self.display {
Display::None => BoxGenerationMode::None,
_ => BoxGenerationMode::Normal,
}
}
#[inline(always)]
#[cfg(feature = "block_layout")]
fn is_block(&self) -> bool {
matches!(self.display, Display::Block)
}
#[inline(always)]
fn box_sizing(&self) -> BoxSizing {
self.box_sizing
}
#[inline(always)]
fn overflow(&self) -> Point<Overflow> {
self.overflow
}
#[inline(always)]
fn scrollbar_width(&self) -> f32 {
self.scrollbar_width
}
#[inline(always)]
fn position(&self) -> Position {
self.position
}
#[inline(always)]
fn inset(&self) -> Rect<LengthPercentageAuto> {
self.inset
}
#[inline(always)]
fn size(&self) -> Size<Dimension> {
self.size
}
#[inline(always)]
fn min_size(&self) -> Size<Dimension> {
self.min_size
}
#[inline(always)]
fn max_size(&self) -> Size<Dimension> {
self.max_size
}
#[inline(always)]
fn aspect_ratio(&self) -> Option<f32> {
self.aspect_ratio
}
#[inline(always)]
fn margin(&self) -> Rect<LengthPercentageAuto> {
self.margin
}
#[inline(always)]
fn padding(&self) -> Rect<LengthPercentage> {
self.padding
}
#[inline(always)]
fn border(&self) -> Rect<LengthPercentage> {
self.border
}
}
impl<T: CoreStyle> CoreStyle for &'_ T {
#[inline(always)]
fn box_generation_mode(&self) -> BoxGenerationMode {
(*self).box_generation_mode()
}
#[inline(always)]
fn is_block(&self) -> bool {
(*self).is_block()
}
#[inline(always)]
fn box_sizing(&self) -> BoxSizing {
(*self).box_sizing()
}
#[inline(always)]
fn overflow(&self) -> Point<Overflow> {
(*self).overflow()
}
#[inline(always)]
fn scrollbar_width(&self) -> f32 {
(*self).scrollbar_width()
}
#[inline(always)]
fn position(&self) -> Position {
(*self).position()
}
#[inline(always)]
fn inset(&self) -> Rect<LengthPercentageAuto> {
(*self).inset()
}
#[inline(always)]
fn size(&self) -> Size<Dimension> {
(*self).size()
}
#[inline(always)]
fn min_size(&self) -> Size<Dimension> {
(*self).min_size()
}
#[inline(always)]
fn max_size(&self) -> Size<Dimension> {
(*self).max_size()
}
#[inline(always)]
fn aspect_ratio(&self) -> Option<f32> {
(*self).aspect_ratio()
}
#[inline(always)]
fn margin(&self) -> Rect<LengthPercentageAuto> {
(*self).margin()
}
#[inline(always)]
fn padding(&self) -> Rect<LengthPercentage> {
(*self).padding()
}
#[inline(always)]
fn border(&self) -> Rect<LengthPercentage> {
(*self).border()
}
}
#[cfg(feature = "block_layout")]
impl BlockContainerStyle for &Style {
#[inline(always)]
fn text_align(&self) -> TextAlign {
self.text_align
}
}
#[cfg(feature = "block_layout")]
impl<T: BlockContainerStyle> BlockContainerStyle for &'_ T {
#[inline(always)]
fn text_align(&self) -> TextAlign {
(*self).text_align()
}
}
#[cfg(feature = "block_layout")]
impl BlockItemStyle for Style {
#[inline(always)]
fn is_table(&self) -> bool {
self.item_is_table
}
}
#[cfg(feature = "block_layout")]
impl<T: BlockItemStyle> BlockItemStyle for &'_ T {
#[inline(always)]
fn is_table(&self) -> bool {
(*self).is_table()
}
}
#[cfg(feature = "flexbox")]
impl FlexboxContainerStyle for Style {
#[inline(always)]
fn flex_direction(&self) -> FlexDirection {
self.flex_direction
}
#[inline(always)]
fn flex_wrap(&self) -> FlexWrap {
self.flex_wrap
}
#[inline(always)]
fn gap(&self) -> Size<LengthPercentage> {
self.gap
}
#[inline(always)]
fn align_content(&self) -> Option<AlignContent> {
self.align_content
}
#[inline(always)]
fn align_items(&self) -> Option<AlignItems> {
self.align_items
}
#[inline(always)]
fn justify_content(&self) -> Option<JustifyContent> {
self.justify_content
}
}
#[cfg(feature = "flexbox")]
impl<T: FlexboxContainerStyle> FlexboxContainerStyle for &'_ T {
#[inline(always)]
fn flex_direction(&self) -> FlexDirection {
(*self).flex_direction()
}
#[inline(always)]
fn flex_wrap(&self) -> FlexWrap {
(*self).flex_wrap()
}
#[inline(always)]
fn gap(&self) -> Size<LengthPercentage> {
(*self).gap()
}
#[inline(always)]
fn align_content(&self) -> Option<AlignContent> {
(*self).align_content()
}
#[inline(always)]
fn align_items(&self) -> Option<AlignItems> {
(*self).align_items()
}
#[inline(always)]
fn justify_content(&self) -> Option<JustifyContent> {
(*self).justify_content()
}
}
#[cfg(feature = "flexbox")]
impl FlexboxItemStyle for Style {
#[inline(always)]
fn flex_basis(&self) -> Dimension {
self.flex_basis
}
#[inline(always)]
fn flex_grow(&self) -> f32 {
self.flex_grow
}
#[inline(always)]
fn flex_shrink(&self) -> f32 {
self.flex_shrink
}
#[inline(always)]
fn align_self(&self) -> Option<AlignSelf> {
self.align_self
}
}
#[cfg(feature = "flexbox")]
impl<T: FlexboxItemStyle> FlexboxItemStyle for &'_ T {
#[inline(always)]
fn flex_basis(&self) -> Dimension {
(*self).flex_basis()
}
#[inline(always)]
fn flex_grow(&self) -> f32 {
(*self).flex_grow()
}
#[inline(always)]
fn flex_shrink(&self) -> f32 {
(*self).flex_shrink()
}
#[inline(always)]
fn align_self(&self) -> Option<AlignSelf> {
(*self).align_self()
}
}
#[cfg(feature = "grid")]
impl GridContainerStyle for Style {
type TemplateTrackList<'a>
= &'a [TrackSizingFunction]
where
Self: 'a;
type AutoTrackList<'a>
= &'a [NonRepeatedTrackSizingFunction]
where
Self: 'a;
#[inline(always)]
fn grid_template_rows(&self) -> &[TrackSizingFunction] {
&self.grid_template_rows
}
#[inline(always)]
fn grid_template_columns(&self) -> &[TrackSizingFunction] {
&self.grid_template_columns
}
#[inline(always)]
fn grid_auto_rows(&self) -> &[NonRepeatedTrackSizingFunction] {
&self.grid_auto_rows
}
#[inline(always)]
fn grid_auto_columns(&self) -> &[NonRepeatedTrackSizingFunction] {
&self.grid_auto_columns
}
#[inline(always)]
fn grid_auto_flow(&self) -> GridAutoFlow {
self.grid_auto_flow
}
#[inline(always)]
fn gap(&self) -> Size<LengthPercentage> {
self.gap
}
#[inline(always)]
fn align_content(&self) -> Option<AlignContent> {
self.align_content
}
#[inline(always)]
fn justify_content(&self) -> Option<JustifyContent> {
self.justify_content
}
#[inline(always)]
fn align_items(&self) -> Option<AlignItems> {
self.align_items
}
#[inline(always)]
fn justify_items(&self) -> Option<AlignItems> {
self.justify_items
}
}
#[cfg(feature = "grid")]
impl<T: GridContainerStyle> GridContainerStyle for &'_ T {
type TemplateTrackList<'a>
= T::TemplateTrackList<'a>
where
Self: 'a;
type AutoTrackList<'a>
= T::AutoTrackList<'a>
where
Self: 'a;
#[inline(always)]
fn grid_template_rows(&self) -> Self::TemplateTrackList<'_> {
(*self).grid_template_rows()
}
#[inline(always)]
fn grid_template_columns(&self) -> Self::TemplateTrackList<'_> {
(*self).grid_template_columns()
}
#[inline(always)]
fn grid_auto_rows(&self) -> Self::AutoTrackList<'_> {
(*self).grid_auto_rows()
}
#[inline(always)]
fn grid_auto_columns(&self) -> Self::AutoTrackList<'_> {
(*self).grid_auto_columns()
}
#[inline(always)]
fn grid_auto_flow(&self) -> GridAutoFlow {
(*self).grid_auto_flow()
}
#[inline(always)]
fn gap(&self) -> Size<LengthPercentage> {
(*self).gap()
}
#[inline(always)]
fn align_content(&self) -> Option<AlignContent> {
(*self).align_content()
}
#[inline(always)]
fn justify_content(&self) -> Option<JustifyContent> {
(*self).justify_content()
}
#[inline(always)]
fn align_items(&self) -> Option<AlignItems> {
(*self).align_items()
}
#[inline(always)]
fn justify_items(&self) -> Option<AlignItems> {
(*self).justify_items()
}
}
#[cfg(feature = "grid")]
impl GridItemStyle for &'_ Style {
#[inline(always)]
fn grid_row(&self) -> Line<GridPlacement> {
self.grid_row
}
#[inline(always)]
fn grid_column(&self) -> Line<GridPlacement> {
self.grid_column
}
#[inline(always)]
fn align_self(&self) -> Option<AlignSelf> {
self.align_self
}
#[inline(always)]
fn justify_self(&self) -> Option<AlignSelf> {
self.justify_self
}
}
#[cfg(feature = "grid")]
impl<T: GridItemStyle> GridItemStyle for &'_ T {
#[inline(always)]
fn grid_row(&self) -> Line<GridPlacement> {
(*self).grid_row()
}
#[inline(always)]
fn grid_column(&self) -> Line<GridPlacement> {
(*self).grid_column()
}
#[inline(always)]
fn align_self(&self) -> Option<AlignSelf> {
(*self).align_self()
}
#[inline(always)]
fn justify_self(&self) -> Option<AlignSelf> {
(*self).justify_self()
}
}
#[cfg(test)]
mod tests {
use super::Style;
use crate::geometry::*;
#[test]
fn defaults_match() {
#[cfg(feature = "grid")]
use super::GridPlacement;
let old_defaults = Style {
display: Default::default(),
item_is_table: false,
box_sizing: Default::default(),
overflow: Default::default(),
scrollbar_width: 0.0,
position: Default::default(),
#[cfg(feature = "flexbox")]
flex_direction: Default::default(),
#[cfg(feature = "flexbox")]
flex_wrap: Default::default(),
#[cfg(any(feature = "flexbox", feature = "grid"))]
align_items: Default::default(),
#[cfg(any(feature = "flexbox", feature = "grid"))]
align_self: Default::default(),
#[cfg(feature = "grid")]
justify_items: Default::default(),
#[cfg(feature = "grid")]
justify_self: Default::default(),
#[cfg(any(feature = "flexbox", feature = "grid"))]
align_content: Default::default(),
#[cfg(any(feature = "flexbox", feature = "grid"))]
justify_content: Default::default(),
inset: Rect::auto(),
margin: Rect::zero(),
padding: Rect::zero(),
border: Rect::zero(),
gap: Size::zero(),
#[cfg(feature = "block_layout")]
text_align: Default::default(),
#[cfg(feature = "flexbox")]
flex_grow: 0.0,
#[cfg(feature = "flexbox")]
flex_shrink: 1.0,
#[cfg(feature = "flexbox")]
flex_basis: super::Dimension::Auto,
size: Size::auto(),
min_size: Size::auto(),
max_size: Size::auto(),
aspect_ratio: Default::default(),
#[cfg(feature = "grid")]
grid_template_rows: Default::default(),
#[cfg(feature = "grid")]
grid_template_columns: Default::default(),
#[cfg(feature = "grid")]
grid_auto_rows: Default::default(),
#[cfg(feature = "grid")]
grid_auto_columns: Default::default(),
#[cfg(feature = "grid")]
grid_auto_flow: Default::default(),
#[cfg(feature = "grid")]
grid_row: Line { start: GridPlacement::Auto, end: GridPlacement::Auto },
#[cfg(feature = "grid")]
grid_column: Line { start: GridPlacement::Auto, end: GridPlacement::Auto },
};
assert_eq!(Style::DEFAULT, Style::default());
assert_eq!(Style::DEFAULT, old_defaults);
}
#[test]
fn style_sizes() {
use super::*;
fn assert_type_size<T>(expected_size: usize) {
let name = ::core::any::type_name::<T>();
let name = name.replace("taffy::geometry::", "");
let name = name.replace("taffy::style::dimension::", "");
let name = name.replace("taffy::style::alignment::", "");
let name = name.replace("taffy::style::flex::", "");
let name = name.replace("taffy::style::grid::", "");
assert_eq!(
::core::mem::size_of::<T>(),
expected_size,
"Expected {} for be {} byte(s) but it was {} byte(s)",
name,
expected_size,
::core::mem::size_of::<T>(),
);
}
assert_type_size::<Display>(1);
assert_type_size::<BoxSizing>(1);
assert_type_size::<Position>(1);
assert_type_size::<Overflow>(1);
assert_type_size::<f32>(4);
assert_type_size::<LengthPercentage>(8);
assert_type_size::<LengthPercentageAuto>(8);
assert_type_size::<Dimension>(8);
assert_type_size::<Size<LengthPercentage>>(16);
assert_type_size::<Size<LengthPercentageAuto>>(16);
assert_type_size::<Size<Dimension>>(16);
assert_type_size::<Rect<LengthPercentage>>(32);
assert_type_size::<Rect<LengthPercentageAuto>>(32);
assert_type_size::<Rect<Dimension>>(32);
assert_type_size::<AlignContent>(1);
assert_type_size::<AlignItems>(1);
assert_type_size::<Option<AlignItems>>(1);
assert_type_size::<FlexDirection>(1);
assert_type_size::<FlexWrap>(1);
assert_type_size::<GridAutoFlow>(1);
assert_type_size::<MinTrackSizingFunction>(8);
assert_type_size::<MaxTrackSizingFunction>(12);
assert_type_size::<NonRepeatedTrackSizingFunction>(20);
assert_type_size::<TrackSizingFunction>(32);
assert_type_size::<Vec<NonRepeatedTrackSizingFunction>>(24);
assert_type_size::<Vec<TrackSizingFunction>>(24);
assert_type_size::<GridPlacement>(4);
assert_type_size::<Line<GridPlacement>>(8);
assert_type_size::<Style>(352);
}
}