Duplo v0.1.1 Duplo.Attr View Source

Link to this section Summary

Functions

Format an attribute to be output in HTML. It dashes the key ("HelloWorld" key becomes "hello-world") and sanitize the value

Link to this section Functions

Format an attribute to be output in HTML. It dashes the key ("HelloWorld" key becomes "hello-world") and sanitize the value

## Examples

  iex> Duplo.Attr.attr({:class, "btn btn-xs btn-primary"})
  "class=\"btn btn-xs btn-primary\""

  iex> Duplo.Attr.attr({"style", "background-color: red;"})
  "style=\"background-color: red;\""