Exemplo n.º 1
0
 /**
  * Check if we successfully add "@import user_settings" to our scss string we
  * want to send to scss php compiler.
  */
 function test_foundation_ui_rebuild_scss_import_file()
 {
     $app_scss_lines = explode("\n", '
   @import "foo";
   @import "settings";
   @import "foundation";
 ');
     $app_scss_string = foundation_ui_rebuild_scss_import_file($app_scss_lines);
     $needle = '@import "' . foudation_ui_get_custom_scss_filename() . '"';
     $this->assertContains($needle, $app_scss_string);
 }
Exemplo n.º 2
0
/**
 * get {theme_name}scss/app.scss file, and add @import of "_custom_settings.scss" just after @import "settings",
 * This is where we store theme custom overrides of _settings.scss variables.
 *
 * @param array $lines
 *   an array of scss lines, as returned by "file" function in php.
 * @return string
 */
function foundation_ui_rebuild_scss_import_file($lines)
{
    $file = '';
    foreach ($lines as $line) {
        $file .= $line . "\r\n";
        $cleaned_line = str_replace(' ', '', $line);
        if (strpos($cleaned_line, "@import'settings'") !== FALSE || strpos($cleaned_line, '@import"settings"') !== FALSE) {
            $file .= '@import "' . foudation_ui_get_custom_scss_filename() . '";' . "\r\n";
        }
    }
    return $file;
}