Elm CSS Parser is a basic CSS parser written in Elm, based on elm/parser.
import CSS.Parser
parsed = CSS.Parser.run "body { background: white }"
-- => Ok [{ properties = [("background","white ")], selectors = ["body"] }]
Result.map CSS.Parser.toString parsed
-- => Ok ("body {\n background: white ;\n}")
-
Comments are parsed but ignored
-
Comments in the component of a declaration is not supported by the parser.
body { background: white /* This comment cannot be parsed */; }