pub struct CSSFeature {
pub id: &'static str,
pub name: &'static str,
pub description: &'static str,
pub spec: &'static str,
pub groups: &'static [&'static str],
pub caniuse: &'static [&'static str],
pub baseline_status: BaselineStatus,
pub browser_support: BrowserSupport,
pub popularity: f32,
}
Fields§
§id: &'static str
The ID of the feature.
name: &'static str
A friendly, human-readable name of the feature.
description: &'static str
A description for this feature.
spec: &'static str
A URL to the CSS specification that includes this feature.
groups: &'static [&'static str]
The groups this feature is part of.
caniuse: &'static [&'static str]
The CanIUse URLs available for this feature.
baseline_status: BaselineStatus
The current BaselineStatus of this feature
browser_support: BrowserSupport
The browsers that support this feature.
popularity: f32
The percentage of web pages which use this feature, as reported by Chrome usage data.
Implementations§
Source§impl CSSFeature
impl CSSFeature
pub fn by_feature_name(name: &str) -> Option<&'static CSSFeature>
pub fn by_property_name(name: &str) -> Option<&'static CSSFeature>
Sourcepub fn has_baseline_support(&self) -> bool
pub fn has_baseline_support(&self) -> bool
Check if a feature has Baseline support.
use css_feature_data::CSSFeature;
assert_eq!(CSSFeature::by_property_name("word-break").is_some_and(|f| f.has_baseline_support()), true)
Sourcepub fn baseline_supported_since(&self) -> Option<NaiveDate>
pub fn baseline_supported_since(&self) -> Option<NaiveDate>
Check the earliest date this feature was supported as Baseline.
If BaselineStatus::Low, then that date will be returned. If BaselineStatus::High, then the low date will be returned.
use css_feature_data::CSSFeature;
use chrono::NaiveDate;
assert_eq!(CSSFeature::by_property_name("word-break").map(|f| f.baseline_supported_since()), Some(NaiveDate::from_ymd_opt(2015,07,29)));
Sourcepub fn group_siblings(&self) -> impl Iterator<Item = &'static CSSFeature>
pub fn group_siblings(&self) -> impl Iterator<Item = &'static CSSFeature>
Get all CSS properties in the same groups as this one
Sourcepub fn spec_siblings(&self) -> impl Iterator<Item = &'static CSSFeature>
pub fn spec_siblings(&self) -> impl Iterator<Item = &'static CSSFeature>
Get all CSS properties in the same specification as this one
Sourcepub fn supports_browserslist(
&self,
browserslist_query: &[&str],
opts: &Opts,
) -> Result<CompatibilityResult, Error>
pub fn supports_browserslist( &self, browserslist_query: &[&str], opts: &Opts, ) -> Result<CompatibilityResult, Error>
Check if a CSS property is supported across browsers specified by a browserslist query
pub fn supports(&self, browser: NamedBrowserVersion) -> bool
Trait Implementations§
Source§impl Clone for CSSFeature
impl Clone for CSSFeature
Source§fn clone(&self) -> CSSFeature
fn clone(&self) -> CSSFeature
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CSSFeature
impl Debug for CSSFeature
Source§impl PartialEq for CSSFeature
impl PartialEq for CSSFeature
impl StructuralPartialEq for CSSFeature
Auto Trait Implementations§
impl Freeze for CSSFeature
impl RefUnwindSafe for CSSFeature
impl Send for CSSFeature
impl Sync for CSSFeature
impl Unpin for CSSFeature
impl UnwindSafe for CSSFeature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more