#[cfg(any(feature = "ssr", feature = "csr"))]
#[macro_export]
macro_rules! style_sheet {
($name:ident, $path:expr, $file_name:expr) => {
mod style_sheet_generated {
$crate::style_sheet_inner!($path);
}
pub use style_sheet_generated::ClassName as $name;
pub static STYLE_SHEET: &'static str = style_sheet_generated::STYLE_SHEET;
$crate::inventory::submit! {
$crate::StyleSheet::new(
$file_name,
Some(style_sheet_generated::STYLE_SHEET),
)
}
};
}
#[cfg(not(any(feature = "ssr", feature = "csr")))]
#[macro_export]
macro_rules! style_sheet {
($name:ident, $path:expr, $file_name:expr) => {
mod style_sheet_generated {
$crate::style_sheet_inner!($path);
}
pub use style_sheet_generated::ClassName as $name;
};
}
#[cfg(any(feature = "ssr", feature = "csr"))]
#[macro_export]
macro_rules! inline_style_sheet {
($name:ident, $file_name:expr, $($tokens:tt)*) => {
mod style_sheet_generated {
$crate::inline_style_sheet_inner!($($tokens)*);
}
pub use style_sheet_generated::ClassName as $name;
pub static STYLE_SHEET: &'static str = style_sheet_generated::STYLE_SHEET;
$crate::inventory::submit! {
$crate::StyleSheet::new(
$file_name,
Some(style_sheet_generated::STYLE_SHEET),
)
}
};
($name:ident, $($tokens:tt)*) => {
mod style_sheet_generated {
$crate::inline_style_sheet_inner!($($tokens)*);
}
pub use style_sheet_generated::ClassName as $name;
pub static STYLE_SHEET: &'static str = style_sheet_generated::STYLE_SHEET;
$crate::inventory::submit! {
$crate::StyleSheet::new(
concat!("inline_", module_path!(), ".css"),
Some(style_sheet_generated::STYLE_SHEET),
)
}
};
($($tokens:tt)*) => {
mod style_sheet_generated {
$crate::inline_style_sheet_inner!($($tokens)*);
}
pub static STYLE_SHEET: &'static str = style_sheet_generated::STYLE_SHEET;
$crate::inventory::submit! {
$crate::StyleSheet::new(
concat!("inline_", module_path!(), ".css"),
Some(style_sheet_generated::STYLE_SHEET),
)
}
};
}
#[cfg(not(any(feature = "ssr", feature = "csr")))]
#[macro_export]
macro_rules! inline_style_sheet {
($name:ident, $file_name:expr, $($tokens:tt)*) => {
mod style_sheet_generated {
$crate::inline_style_sheet_inner!($($tokens)*);
}
pub use style_sheet_generated::ClassName as $name;
};
($name:ident, $($tokens:tt)*) => {
mod style_sheet_generated {
$crate::inline_style_sheet_inner!($($tokens)*);
}
pub use style_sheet_generated::ClassName as $name;
};
($($tokens:tt)*) => {
mod style_sheet_generated {
$crate::inline_style_sheet_inner!($($tokens)*);
}
};
}