You are here

public function SassExtentionsCompassFunctionsUrls::stylesheet_url in Sassy 7

File

phamlp/sass/extensions/compass/functions/urls.php, line 19

Class

SassExtentionsCompassFunctionsUrls
Compass extension SassScript urls functions class. A collection of functions for use in SassSCript. @package PHamlP @subpackage Sass.extensions.compass.functions

Code

public function stylesheet_url($path, $only_path = null) {
  $path = $path->value;

  # get to the string value of the literal.

  # Compute the $path to the stylesheet, either root relative or stylesheet relative

  # or nil if the http_images_path is not set in the configuration.
  if (SassExtentionsCompassConfig::config('relative_assets')) {
    $http_css_path = self::compute_relative_path(SassExtentionsCompassConfig::config('css_path'));
  }
  elseif (SassExtentionsCompassConfig::config('http_css_path')) {
    $http_css_path = SassExtentionsCompassConfig::config('http_css_path');
  }
  else {
    $http_css_path = SassExtentionsCompassConfig::config('css_dir');
  }
  return new SassString(self::clean("{$http_css_path}/{$path}", $only_path));
}