JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 102157
  • Score
    100M100P100Q150211F
  • License MIT

Parse and stringify style attributes

Package Exports

  • style-attr

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (style-attr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

style-attr

Very simple parsing and stringifying of style attributes.

Build Status

parse

Convert a style attribute string to an object.

  • inputs:

    • string (eg. anything you might see in a style attribute)
    • options (optional)
  • return: object

stringify

Convert an object into an attribute string

  • input: object
  • return: string

normalize

Normalize an attribute string (eg. collapse duplicates)

  • inputs:

  • return: string

Args

options

Options for parse() and normalize follow the same format:

{
  preserveNumbers: boolean // (default: false)
}

Setting preserveNumbers to true recognises number values and converts them to a Number.

License

MIT