packages/heml-elements/src/Typography.js
function createTextElement (name, element = {}) {
  let classToAdd = ''
  const Tag = name

  if (/^h\d$/i.test(name)) {
    classToAdd = 'header'
  } else {
    classToAdd = 'text'
  }

  return createElement(name, merge({
    attrs: true,
    rules: {
      [`.${name}.${classToAdd}`]: [ { '@pseudo': 'root' }, '@default', { display: transforms.trueHide() }, margin, background, border, borderRadius, text, font ]
    },
    render (attrs, contents) {
      attrs.class += ` ${classToAdd} ${name}`

      return <Tag {...attrs}>{contents}</Tag>
    }
  }, element))
}
function createTextElement (name, element = {}) {
  let classToAdd = ''
  const Tag = name

  if (/^h\d$/i.test(name)) {
    classToAdd = 'header'
  } else {
    classToAdd = 'text'
  }

  return createElement(name, merge({
    attrs: true,
    rules: {
      [`.${name}.${classToAdd}`]: [ { '@pseudo': 'root' }, '@default', { display: transforms.trueHide() }, margin, background, border, borderRadius, text, font ]
    },
    render (attrs, contents) {
      attrs.class += ` ${classToAdd} ${name}`

      return <Tag {...attrs}>{contents}</Tag>
    }
  }, element))
}
function createTextElement ( name , element = { } ) { let classToAdd = '' const Tag = name if ( / ^h\d$ / i . test ( name ) ) { classToAdd = 'header' } else { classToAdd = 'text' } return createElement ( name , merge ( { attrs : true , rules : { [ ` ${ name } ${ classToAdd } ` ] : [ { '@pseudo' : 'root' } , '@default' , { display : transforms . trueHide ( ) } , margin , background , border , borderRadius , text , font ] } , render ( attrs , contents ) { attrs . class += ` ${ classToAdd } ${ name } ` return < Tag { ... attrs } > { contents } < / Tag > } } , element ) ) }
create mergable text element
@param  {String} name
@param  {Object} element
@return {Object}
create mergable text element