<?php

/**
 * Adds support for wp.com-specific theme functions.
 *
 * @global array $themecolors
 * @since Suits 1.0
 *
 */
function suits_wpcom_setup() {
	global $themecolors;

	// Set theme colors for third party services.
	if ( ! isset( $themecolors ) ) {
		$themecolors = array(
			'bg'     => 'ffffff',
			'border' => 'e5e5e5',
			'text'   => '333333',
			'link'   => 'bb0000',
			'url'    => 'bb0000',
		);
	}

	// Enable support for WP.com global print style.
	add_theme_support( 'print-style' );
}
add_action( 'after_setup_theme', 'suits_wpcom_setup' );

/**
 * Dequeue font styles when Typekit is active.
 *
 * @since Suits 1.0
 */
function suits_dequeue_fonts() {
  if ( class_exists( 'TypekitData' ) && class_exists( 'CustomDesign' ) && CustomDesign::is_upgrade_active() ) {
    $customfonts = TypekitData::get( 'families' );

    if ( $customfonts && ( $customfonts['site-title']['id'] || $customfonts['headings']['id'] ) )
      wp_dequeue_style( 'suits-fontstack' );
  }
}
add_action( 'wp_enqueue_scripts', 'suits_dequeue_fonts' );