You are here

function _cufon_parse_css_properties in Cufón 6

_cufon_parse_css_properties().

Parses out all extra effects added to the selector. Example: CSS Format: <selector> { <effect>:<value>; <effect>:<value>; } h2 { textShadow:0 1px #fff; color:-linear-gradient(white, #990000); };

1 call to _cufon_parse_css_properties()
cufon_preprocess_page in ./cufon.module
Implementation of hook_preprocess_page().

File

./cufon.module, line 117
Adds simple Cufón support to Drupal.

Code

function _cufon_parse_css_properties(&$selectors) {
  foreach ($selectors as &$selector) {
    $a = explode('{', $selector['selector']);
    if (count($a) > 1) {
      $new = array();
      $new['selector'] = $a[0];
      $new['options'] = $selector['options'];
      $p = explode(';', str_replace(array(
        '  ',
        '}',
      ), array(
        ' ',
        '',
      ), $a[1]));
      foreach ($p as $property) {
        $parts = explode(':', $property);
        if (trim($parts[0]) == '' || trim($parts[1]) == '') {
          continue;
        }
        $new['options'][trim($parts[0])] = trim($parts[1]);
      }
      $selector = $new;
    }
  }
}