ad-si/elm-stylus/1.0.0

Stylus.Parser

Convert a strict subset of Stylus to CSS

stylusToCss : String -> Result (List (DeadEnd Context Problem)) String
stylusToCss """
div
  width 400px
  height 300px
"""

yields

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

Internal

= Rule ( Selectors, RuleContent )
| Comment String
| Newlines
type Problem
= BadIndent
| BadKeyword String
| GenericProblem
selector : StyParser String
selectors : StyParser Selectors

Parse selectors ending with newline

-> StyParser (Step (List Expression) (List Expression))
rule : StyParser Expression

Parse a top-level rule

List Declaration
-> StyParser (Step (List Declaration) (List Declaration))

Parse a declaration (kept for backwards compatibility)

declarations : StyParser (List Declaration)

Parse declarations (kept for backwards compatibility)

newlines : StyParser Expression
stylus : StyParser (List Expression)