You are here

function sassy_compass_sassy_resolve_path_compass in Sassy 7.3

Same name and namespace in other branches
  1. 7.2 extensions/compass/sassy_compass.module \sassy_compass_sassy_resolve_path_compass()

Implements hook_sassy_resolve_path_NAMESPACE().

File

sassy_compass/sassy_compass.module, line 23

Code

function sassy_compass_sassy_resolve_path_compass($filename, $syntax = 'scss') {
  $path = drupal_get_path('module', 'sassy_compass');
  if ($filename == '*') {
    $filename = 'compass';
  }
  $filename = str_replace(array(
    '.scss',
    '.sass',
  ), '', $filename);
  $split = explode('/', $filename);
  if ($split[0] != 'compass' && $split[0] != 'lemonade') {
    array_unshift($split, 'compass');
  }
  $last = array_pop($split) . '.scss';
  if (substr($last, 0, 1) != '_') {
    $last = '_' . $last;
  }
  array_unshift($split, 'stylesheets');
  array_unshift($split, $path);
  $filename = str_replace('/_', '/', implode('/', $split)) . '/' . $last;

  // print $filename . "<br/>\n";
  return $filename;
}