<?php

namespace Hecate\Style\Parsers;

use Hecate\Lodash;

class Typography extends BaseParser {


	public static $default = array(
		'family'        => '',
		'weight'        => '',
		'size'          => '',
		'lineHeight'    => '',
		'letterSpacing' => '',
		'color'         => '',
		'textTransform' => '',
	);

	public static function parse( $data = array() ) {
		$mergedData = Lodash::merge( static::$default, $data );

		$properties = array();
		if ( $mergedData['color'] ) {
			$properties['color'] = $mergedData['color'];
		}

		if ( $mergedData['size'] ) {
			$properties['font-size'] = Utils::getValueWithUnit( $mergedData['size'] );
		}

		if ( $mergedData['weight'] ) {
			$properties['font-weight'] = $mergedData['weight'];
		}

		return $properties;

	}
}
