You are here

function sassy_bootstrap_prepro_precompile_sass_alter in Sassy 7.2

Adds the bootstrap libraries to all SASS files if the user selected this option in the Prepro admin screen.

1 call to sassy_bootstrap_prepro_precompile_sass_alter()
sassy_bootstrap_prepro_precompile_scss_alter in extensions/bootstrap/sassy_bootstrap.module
Adds the bootstrap libraries to all SCSS files if the user selected this option in the Prepro admin screen.

File

extensions/bootstrap/sassy_bootstrap.module, line 77

Code

function sassy_bootstrap_prepro_precompile_sass_alter(&$contents, $file, $local) {
  if (@$local['bootstrap_implicit_include']) {
    if (strpos($contents, 'bootstrap/bootstrap') === FALSE && strpos($contents, 'bootstrap/*') === FALSE) {
      $comment = '/* ' . t('Including bootstrap libraries via implicit include') . ' */';
      $contents = $comment . "\n@import 'bootstrap/bootstrap';\n\n" . $contents;
    }
  }
}