diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..13b16c7 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "grass" +version = "0.1.0" +authors = ["ConnorSkees <39542938+ConnorSkees@users.noreply.github.com>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/main.rs b/src/main.rs index 6ba8419..aa0ab59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -211,6 +211,104 @@ impl StyleSheet { pub fn pretty_print(&self, buf: W) -> io::Result<()> { PrettyPrinter::new(buf).pretty_print(self) } + + pub fn pretty_print_selectors(&self, buf: W) -> io::Result<()> { + PrettyPrinter::new(buf).pretty_print_preserve_super_selectors(self) + } + + pub fn print_as_css(self, buf: &mut W) -> io::Result<()> { + Css::from_stylesheet(self).pretty_print(buf) + } +} + +#[derive(Debug, Clone)] +pub struct Block { + selector: Selector, + styles: Vec