You are here

function sassy_compass__prefixed in Sassy 7.3

Same name and namespace in other branches
  1. 7.2 extensions/compass/functions/cross_browser_support.inc \sassy_compass__prefixed()

File

sassy_compass/functions/cross_browser_support.inc, line 4

Code

function sassy_compass__prefixed($prefix, $list) {
  $list = sassy_compass__list($list);
  $prefix = trim(preg_replace('/[^a-z]/', '', strtolower($prefix)));

  # thanks http://www.quirksmode.org/css/contents.html
  $reqs = array(
    'pie' => array(
      'border-radius',
      'box-shadow',
      'border-image',
      'background',
      'linear-gradient',
    ),
    'webkit' => array(
      'background-clip',
      'background-origin',
      'border-radius',
      'box-shadow',
      'box-sizing',
      'columns',
      'gradient',
      'linear-gradient',
      'text-stroke',
    ),
    'moz' => array(
      'background-size',
      'border-radius',
      'box-shadow',
      'box-sizing',
      'columns',
      'gradient',
      'linear-gradient',
    ),
    'o' => array(
      'background-origin',
      'text-overflow',
    ),
  );
  foreach ($list as $item) {
    $aspect = trim(current(explode('(', $item)));
    if (isset($reqs[$prefix]) && in_array($aspect, $reqs[$prefix])) {
      return new SassBoolean(TRUE);
    }
  }
  return new SassBoolean(FALSE);
}