/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Common feature values between media and container features.
usecrate::derives::*; use app_units::Au; use euclid::default::Size2D;
impl Orientation { /// A helper to evaluate a orientation query given a generic size getter. pubfn eval(size: Size2D<Au>, value: Option<Self>) -> bool { let query_orientation = match value {
Some(v) => v,
None => returntrue,
};
// Per spec, square viewports should be 'portrait' let is_landscape = size.width > size.height; match query_orientation { Self::Landscape => is_landscape, Self::Portrait => !is_landscape,
}
}
}
/// Values for the prefers-color-scheme media feature. #[derive(Clone, Copy, Debug, FromPrimitive, Parse, PartialEq, ToCss)] #[repr(u8)] #[allow(missing_docs)] pubenum PrefersColorScheme {
Light,
Dark,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.