adius / vectual / Stylus.Parser

Convert a strict subset of Stylus to CSS

stylusToCss : String -> Result (List (Parser.Advanced.DeadEnd Context Problem)) String

stylusToCss """
div
  width 400px
  height 300px
"""

yields

div { width: 400px; height: 300px; }

Internal


type Expression
    = Rule (( Selectors, List Declaration ))
    | Comment String
    | Newlines


type Problem
    = BadIndent
    | BadKeyword String
    | GenericProblem

selector : StyParser String

selectors : StyParser Selectors

section : List Expression -> StyParser (Parser.Advanced.Step (List Expression) (List Expression))

rule : StyParser Expression

declaration : List Declaration -> StyParser (Parser.Advanced.Step (List Declaration) (List Declaration))

declarations : StyParser (List Declaration)

newlines : StyParser Expression

commentLine : StyParser Expression

stylus : StyParser (List Expression)

serializeStylusAst : List Expression -> String