JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2534
  • Score
    100M100P100Q104072F
  • License ISC

JavaScript Utility to convert shorthand CSS properties into subcomponents

Package Exports

  • style-builder

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-builder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Style Builder

A JavaScript utility to break apart shorthand CSS components in objects.

When using inline styles with React components, it can be dangerous to use shorthand CSS properties. As a work around, use StyleBuilder to break apart any shorthand properties that exist in your style objects.

Read our blog post here

Example

const StyleBuilder = require("style-builder");

const _styles = StyleBuilder.build({
  margin: "5px 10px"
});

console.log(_styles);
{
  marginTop: "5px",
  marginRight: "10px",
  marginBottom: "5px",
  marginLeft: "10px"
}

Build

npm run-script build

Test

npm test

TODO

  • background
  • font
  • transition
  • transform
  • list-style