diff options
author | 2021-09-20 15:54:19 +0700 | |
---|---|---|
committer | 2021-09-20 15:54:19 +0700 | |
commit | 35c4ad6dd950fa91d181f4d3253fcb486bcf1b11 (patch) | |
tree | 8420a91cd319a63b1ed257a6334453a1a673bdfb /web/src/css.rs | |
parent | 456a3f15e4226cc781a8825bddaaf066476d4351 (diff) | |
parent | a0ad3996225601aaa1ebe051cba115374b55c80e (diff) | |
download | iced-35c4ad6dd950fa91d181f4d3253fcb486bcf1b11.tar.gz iced-35c4ad6dd950fa91d181f4d3253fcb486bcf1b11.tar.bz2 iced-35c4ad6dd950fa91d181f4d3253fcb486bcf1b11.zip |
Merge pull request #1044 from tarkah/feature/align-fill-variant
Add Align::Fill variant
Diffstat (limited to 'web/src/css.rs')
-rw-r--r-- | web/src/css.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/web/src/css.rs b/web/src/css.rs index 21f51f85..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, Length, Padding}; +use crate::bumpalo; +use crate::{Alignment, Background, Color, Length, Padding}; use std::collections::BTreeMap; @@ -195,12 +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 [`Alignment`]. +pub fn alignment(alignment: Alignment) -> &'static str { + match alignment { + Alignment::Start => "flex-start", + Alignment::Center => "center", + Alignment::End => "flex-end", + Alignment::Fill => "stretch", } } |