style/values/specified/
flex.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5//! Specified types for CSS values related to flexbox.
6
7use crate::values::generics::flex::FlexBasis as GenericFlexBasis;
8use crate::values::specified::Size;
9
10/// A specified value for the `flex-basis` property.
11pub type FlexBasis = GenericFlexBasis<Size>;
12
13impl FlexBasis {
14    /// `auto`
15    #[inline]
16    pub fn auto() -> Self {
17        GenericFlexBasis::Size(Size::auto())
18    }
19
20    /// `0%`
21    #[inline]
22    pub fn zero_percent() -> Self {
23        GenericFlexBasis::Size(Size::zero_percent())
24    }
25}