pub struct Browsers {
pub android: Option<u32>,
pub chrome: Option<u32>,
pub edge: Option<u32>,
pub firefox: Option<u32>,
pub ie: Option<u32>,
pub ios_saf: Option<u32>,
pub opera: Option<u32>,
pub safari: Option<u32>,
pub samsung: Option<u32>,
}Expand description
Browser versions to compile CSS for.
Versions are represented as a single 24-bit integer, with one byte
per major.minor.patch component.
§Example
This example represents a target of Safari 13.2.0.
use lightningcss::targets::Browsers;
let targets = Browsers {
safari: Some((13 << 16) | (2 << 8)),
..Browsers::default()
};Fields§
§android: Option<u32>§chrome: Option<u32>§edge: Option<u32>§firefox: Option<u32>§ie: Option<u32>§ios_saf: Option<u32>§opera: Option<u32>§safari: Option<u32>§samsung: Option<u32>Implementations§
Source§impl Browsers
impl Browsers
Sourcepub fn from_browserslist<S: AsRef<str>, I: IntoIterator<Item = S>>(
query: I,
) -> Result<Option<Browsers>, Error>
Available on crate feature browserslist only.
pub fn from_browserslist<S: AsRef<str>, I: IntoIterator<Item = S>>( query: I, ) -> Result<Option<Browsers>, Error>
browserslist only.Parses a list of browserslist queries into Lightning CSS targets.
Sourcepub fn from_browserslist_with_config<S: AsRef<str>, I: IntoIterator<Item = S>>(
query: I,
config: BrowserslistConfig,
) -> Result<Option<Browsers>, Error>
Available on crate feature browserslist only.
pub fn from_browserslist_with_config<S: AsRef<str>, I: IntoIterator<Item = S>>( query: I, config: BrowserslistConfig, ) -> Result<Option<Browsers>, Error>
browserslist only.Parses a list of browserslist queries into Lightning CSS targets.
Sourcepub fn load_browserslist() -> Result<Option<Browsers>, Error>
Available on crate feature browserslist and non-WebAssembly only.
pub fn load_browserslist() -> Result<Option<Browsers>, Error>
browserslist and non-WebAssembly only.Finds browserslist configuration, selects queries by environment and loads the resulting queries into LightningCSS targets.
Configuration resolution is modeled after the original browserslist nodeJS package.
The configuration is resolved in the following order:
- If a
BROWSERSLISTenvironment variable is present, then load targets from its value. This is analog to the--targetsCLI option. Example:BROWSERSLIST="firefox ESR" lightningcss [OPTIONS] <INPUT_FILE> - If a
BROWSERSLIST_CONFIGenvironment variable is present, then resolve the file at the provided path. Then parse and use targets frompackage.jsonor any browserslist configuration file pointed to by the environment variable. Example:BROWSERSLIST_CONFIG="../config/browserslist" lightningcss [OPTIONS] <INPUT_FILE> - If none of the above apply, then find, parse and use targets from the first
browserslist,.browserslistrcorpackage.jsonconfiguration file in any parent directory.
When using parsed configuration from browserslist, .browserslistrc or package.json configuration files,
the environment determined by:
- the
BROWSERSLIST_ENVenvironment variable if present, - otherwise the
NODE_ENVenvironment varialbe if present, - otherwise
productionis used.
If no targets are found for the resulting environment, then the defaults configuration section is used.
Trait Implementations§
impl Copy for Browsers
Source§impl<'de> Deserialize<'de> for Browsers
Available on crate features nodejs or serde only.
impl<'de> Deserialize<'de> for Browsers
nodejs or serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Browsers
impl StructuralPartialEq for Browsers
Auto Trait Implementations§
impl Freeze for Browsers
impl RefUnwindSafe for Browsers
impl Send for Browsers
impl Sync for Browsers
impl Unpin for Browsers
impl UnsafeUnpin for Browsers
impl UnwindSafe for Browsers
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.