diff options
Diffstat (limited to 'web/src/css.rs')
-rw-r--r-- | web/src/css.rs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/web/src/css.rs b/web/src/css.rs index c132d045..07589150 100644 --- a/web/src/css.rs +++ b/web/src/css.rs @@ -1,5 +1,6 @@ //! Style your widgets. -use crate::{bumpalo, Align, Background, Color, CrossAlign, Length, Padding}; +use crate::bumpalo; +use crate::{Alignment, Background, Color, Length, Padding}; use std::collections::BTreeMap; @@ -195,22 +196,13 @@ pub fn background(background: Background) -> String { } } -/// Returns the style value for the given [`Align`]. -pub fn align(align: Align) -> &'static str { - match align { - Align::Start => "flex-start", - Align::Center => "center", - Align::End => "flex-end", - } -} - -/// Returns the style value for the given [`CrossAlign`]. -pub fn cross_align(align: CrossAlign) -> &'static str { - match align { - CrossAlign::Start => "flex-start", - CrossAlign::Center => "center", - CrossAlign::End => "flex-end", - CrossAlign::Fill => "stretch", +/// Returns the style value for the given [`Alignment`]. +pub fn alignment(alignment: Alignment) -> &'static str { + match alignment { + Alignment::Start => "flex-start", + Alignment::Center => "center", + Alignment::End => "flex-end", + Alignment::Fill => "stretch", } } |