use codemap::Spanned; use crate::{error::SassResult, value::Value}; /// A style: `color: red` #[derive(Clone, Debug, Eq, PartialEq)] pub(crate) struct Style { pub property: String, pub value: Spanned, } impl Style { pub fn to_string(&self) -> SassResult { Ok(format!( "{}: {};", self.property, self.value.node.to_css_string(self.value.span)? )) } pub(crate) fn eval(self) -> SassResult { Ok(Style { property: self.property, value: Spanned { span: self.value.span, node: self.value.node.eval(self.value.span)?.node, }, }) } }