[][src]Struct grass::StyleSheet

pub struct StyleSheet(_);

Represents a parsed SASS stylesheet with nesting

Methods

impl StyleSheet[src]

pub fn new(input: String) -> SassResult<String>[src]

Write CSS to buf, constructed from a string

use grass::{SassResult, StyleSheet};

fn main() -> SassResult<()> {
    let sass = StyleSheet::new("a { b { color: red; } }".to_string())?;
    assert_eq!(sass, "a b {\n  color: red;\n}\n");
    Ok(())
}

pub fn from_path<P: AsRef<Path> + Into<String> + Clone>(
    p: P
) -> SassResult<String>
[src]

Write CSS to buf, constructed from a path

use grass::{SassResult, StyleSheet};

fn main() -> SassResult<()> {
    let sass = StyleSheet::from_path("input.scss")?;
    Ok(())
}

Trait Implementations

impl Clone for StyleSheet[src]

impl Debug for StyleSheet[src]

impl Display for StyleSheet[src]

Print the internal representation of a parsed stylesheet

Very closely resembles the original SASS, but contains only things translatable to pure CSS: functions, variables, values, and mixins have all been evaluated.

Use StyleSheet::print_as_css to properly convert to CSS.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,