Esempio n. 1
0
 /**
  * Check we are able to load scssphp compiler
  */
 function test_foundation_ui_get_scssphp_compiler()
 {
     $object = foundation_ui_get_scss_compiler();
     $this->assertInstanceof('scssc', $object);
 }
Esempio n. 2
0
/**
 * Compile a scss string for a specific theme with phpscss compiler.
 * This only convert a scss string to a css string, setting import paths
 * correctly for our okcdesign theme and subthemes.
 *
 * @param string $themename : The theme we want to recompile all the scss for.
 * @param string $scss_string : a valid scss string to compile.
 * @return string : A valid css string, ready to be stored in a file.
 */
function foundation_ui_compile_theme_scss($themename, $scss_string)
{
    $okcdesign_theme_path = drupal_get_path('theme', 'okcdesign');
    // configure import paths for our php scss compilator.
    // Important : we add an import path to our custom theme scss directory, containing
    // scss defined by user from admin settings page.
    $import_paths = array("{$okcdesign_theme_path}/bower_components/foundation/scss", "{$okcdesign_theme_path}/scss", foundation_ui_theme_directory_path($themename));
    $scss = foundation_ui_get_scss_compiler();
    $scss->setImportPaths($import_paths);
    $css_string = $scss->compile($scss_string);
    return $css_string;
}