You are here

function sassy_load_callback in Sassy 7.3

Same name and namespace in other branches
  1. 7.2 sassy.module \sassy_load_callback()

Called from inside SassParser when a file is trying to be loaded.

Parameters

$file: The file trying to be loaded, eg 'myfile/bla.scss'

Return value

An array of 0 - n filenames to load. If no valid files are found return array() or FALSE

1 string reference to 'sassy_load_callback'
sassy_parse in ./sassy.module
Parse a SCSS string and transform it into CSS.

File

./sassy.module, line 197
Handles compiling of .sass / .scss files.

Code

function sassy_load_callback($file) {
  $file = explode('/', $file, 2);
  $namespace = preg_replace('/[^0-9a-z]+/i', '_', array_shift($file));
  foreach (module_implements('sassy_resolve_path_' . $namespace) as $module) {
    $hook = $module . '_sassy_resolve_path_' . $namespace;
    if (function_exists($hook) && ($paths = call_user_func($hook, $file[0]))) {
      return (array) $paths;
    }
  }
  return FALSE;
}