grass/src/style.rs
2020-07-10 00:17:15 -04:00

21 lines
459 B
Rust

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