Module

CSS.Validate

Package
purescript-css-validate
Repository
nonbili/purescript-css-validate

#isClassNameValid Source

isClassNameValid :: String -> Boolean

A valid class name must begins with an underscore (_), a hyphen (-), or a letter(a–z), followed by any number of hyphens, underscores, letters, or numbers. See https://stackoverflow.com/a/449000

isClassNameValid "abc" == true

isClassNameValid "123" == false

#isDeclarationValid Source

isDeclarationValid :: String -> String -> Boolean

Validate CSS roperty and value.

isDeclarationValid "color" "white" == true

isDeclarationValid "color" "bg" == false

#Declaration Source

type Declaration = { important :: Boolean, property :: String, valid :: Boolean, value :: String }

A type to represent a CSS declaration. https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#CSS_declarations

#parseDeclaration Source

parseDeclaration :: String -> String -> Either Error Declaration

Parse CSS property and value to Declaration.

Modules
CSS.Validate