use crate::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
#[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(C, u8)]
pub enum GenericBackgroundSize<LengthPercent> {
ExplicitSize {
width: GenericLengthPercentageOrAuto<LengthPercent>,
#[css(skip_if = "GenericLengthPercentageOrAuto::is_auto")]
height: GenericLengthPercentageOrAuto<LengthPercent>,
},
#[animation(error)]
Cover,
#[animation(error)]
Contain,
}
pub use self::GenericBackgroundSize as BackgroundSize;
impl<LengthPercentage> BackgroundSize<LengthPercentage> {
pub fn auto() -> Self {
GenericBackgroundSize::ExplicitSize {
width: LengthPercentageOrAuto::Auto,
height: LengthPercentageOrAuto::Auto,
}
}
}