rofrischmann/elodin

View on GitHub
utils/css/src/stringifyRule.js

Summary

Maintainability
A
0 mins
Test Coverage
import { hyphenateProperty } from 'css-in-js-utils'

export default function stringifyRule(declarations, name, indent = '') {
  return (
    indent +
    '.' +
    name +
    ' {\n  ' +
    indent +
    declarations
      .map(decl => hyphenateProperty(decl.property) + ': ' + decl.value)
      .join(';\n  ' + indent) +
    '\n' +
    indent +
    '}'
  )
}