style/values/computed/
effects.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//! Computed types for CSS values related to effects.
6
7use crate::values::computed::color::Color;
8use crate::values::computed::length::{Length, NonNegativeLength};
9#[cfg(feature = "gecko")]
10use crate::values::computed::url::ComputedUrl;
11use crate::values::computed::{Angle, NonNegativeNumber, ZeroToOneNumber};
12use crate::values::generics::effects::BoxShadow as GenericBoxShadow;
13use crate::values::generics::effects::Filter as GenericFilter;
14use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow;
15#[cfg(not(feature = "gecko"))]
16use crate::values::Impossible;
17
18/// A computed value for a single shadow of the `box-shadow` property.
19pub type BoxShadow = GenericBoxShadow<Color, Length, NonNegativeLength, Length>;
20
21/// A computed value for a single `filter`.
22#[cfg(feature = "gecko")]
23pub type Filter = GenericFilter<
24    Angle,
25    NonNegativeNumber,
26    ZeroToOneNumber,
27    NonNegativeLength,
28    SimpleShadow,
29    ComputedUrl,
30>;
31
32/// A computed value for a single `filter`.
33#[cfg(feature = "servo")]
34pub type Filter = GenericFilter<
35    Angle,
36    NonNegativeNumber,
37    ZeroToOneNumber,
38    NonNegativeLength,
39    SimpleShadow,
40    Impossible,
41>;
42
43/// A computed value for the `drop-shadow()` filter.
44pub type SimpleShadow = GenericSimpleShadow<Color, Length, NonNegativeLength>;