You are here

function sassy_compass__url in Sassy 7.2

Same name and namespace in other branches
  1. 7.3 sassy_compass/functions/urls.inc \sassy_compass__url()
5 calls to sassy_compass__url()
sassy_compass__font_url in extensions/compass/functions/urls.inc
sassy_compass__image_info in extensions/compass/functions/image_size.inc
sassy_compass__image_url in extensions/compass/functions/urls.inc
sassy_compass__inline_image in extensions/compass/functions/inline_image.inc
sassy_compass__stylesheet_url in extensions/compass/functions/urls.inc

File

extensions/compass/functions/urls.inc, line 17

Code

function sassy_compass__url($path, $only_path = FALSE, $web_path = TRUE) {
  $opath = $path;
  if (!($path = SassFile::get_file($path, SassParser::$instance, false))) {
    throw new Exception('File not found: ' . $opath);
  }
  $path = $path[0];
  if ($web_path) {
    $webroot = realpath(DRUPAL_ROOT) . '/';
    $path = str_replace($webroot, '', $path);
    $path = file_create_url($path);
  }
  if ($only_path) {
    return new SassString($path);
  }
  return new SassString("url('{$path}')");
}