Method Web.Sass.Compiler()->handle_sass_import()


Method handle_sass_import

protected string|array(string(8bit)) handle_sass_import(string(8bit) path, void|string(8bit) absolute_path, void|string(8bit) relative_path)

Description

Resolve imports in sass/scss files.

Note

In general this method doesn't need to overloaded. In principle it's only necessary if the Sass files reside in a non-standard filesystem.

Note

If overloaded abs_path and rel_path is the absolute and relaive paths of the file containing the import statement path. If the Sass/SCSS files are located in a normal filesystem this method can return the contents of path as a string and libsass will resolve the paths to the imports by itself.

However, if the files are not located in a normal filesystem this function should return an array of two indices, where the first index should be the contents of path and the second the calculated absolute path of path.

Parameter path

This is the value of `path` in @import 'path'.

Parameter absolute_path

This is the absolute path of the file containing the @import statement.

Parameter relative_path

The relative path of absolute_path in relation to the prevoius absolute_path

Returns
int(0)

If undefined is returned the import resolution is given back to libsass.

string(8bit)

The contents of path

array(string(8bit))

if an array is returned it should contain two indices, where the first if the contents of path and the second should be the absolute path path. This is only useful (needed) if the Sass files doesn't reside in a normal filesystem that libsass can read.