lightningcss/rules/
counter_style.rsuse super::Location;
use crate::declaration::DeclarationBlock;
use crate::error::PrinterError;
use crate::printer::Printer;
use crate::traits::ToCss;
use crate::values::ident::CustomIdent;
#[cfg(feature = "visitor")]
use crate::visitor::Visit;
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "visitor", derive(Visit))]
#[cfg_attr(feature = "into_owned", derive(static_self::IntoOwned))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
pub struct CounterStyleRule<'i> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub name: CustomIdent<'i>,
pub declarations: DeclarationBlock<'i>,
#[cfg_attr(feature = "visitor", skip_visit)]
pub loc: Location,
}
impl<'i> ToCss for CounterStyleRule<'i> {
fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
where
W: std::fmt::Write,
{
#[cfg(feature = "sourcemap")]
dest.add_mapping(self.loc);
dest.write_str("@counter-style ")?;
self.name.to_css(dest)?;
self.declarations.to_css_block(dest)
}
}