# `StylesheetParser.Stylesheet`
[🔗](https://github.com/zestcreative/stylesheet_parser/blob/v0.1.0/lib/stylesheet_parser/stylesheet.ex#L1)

A parsed stylesheet, from `StylesheetParser.parse_stylesheet/1`.

  * `rules` - its `StylesheetParser.QualifiedRule`s and `StylesheetParser.AtRule`s, in order.
  * `errors` - a `StylesheetParser.ParseError` for each thing it dropped or recovered from, in
    the order they are in the input.

`to_string/1` serializes its rules, one a line.

    iex> {:ok, stylesheet} = StylesheetParser.parse_stylesheet("a { color: red } b { color: blue; oops }")
    iex> Enum.map(stylesheet.rules, &to_string/1)
    ["a { color: red; }", "b { color: blue; }"]
    iex> Enum.map(stylesheet.errors, &Exception.message/1)
    ["1:35: expected : after oops"]
    iex> to_string(stylesheet)
    "a { color: red; }\nb { color: blue; }"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
