Skip to content
Snippets Groups Projects
Commit 1dde906f authored by Vladimir Roudakov's avatar Vladimir Roudakov Committed by Vladimir Roudakov
Browse files

Issue #3026316 by VladimirAus: Subtheme SASS is not compiling

parent ad2d388d
No related branches found
No related tags found
No related merge requests found
......@@ -78,8 +78,8 @@ function bootstrap4_form_system_theme_settings_alter(&$form, FormStateInterface
*/
function bootstrap4_form_system_theme_settings_submit($form, FormStateInterface $form_state) {
$active_theme = \Drupal::service('theme.manager')->getActiveTheme()->getName();
$cssFilename = $active_theme . '.sass.css';
_bootstrap4_sass_compile($cssFilename);
$css_filename = $active_theme . '.sass.css';
_bootstrap4_sass_compile($css_filename);
}
/**
......@@ -99,17 +99,23 @@ function bootstrap4_css_alter(&$css, \Drupal\Core\Asset\AttachedAssetsInterface
$active_theme = \Drupal::service('theme.manager')->getActiveTheme()->getName();
$pathfull = \Drupal::service('file_system')->realpath('public://' . $active_theme);
$cssPath = str_replace(DRUPAL_ROOT . '/', '', $pathfull);
$cssFilename = $active_theme . '.sass.css';
$originalCss = 'themes/custom/bootstrap4/css/bootstrap4.sass.css';
$css_path = str_replace(DRUPAL_ROOT . '/', '', $pathfull);
$css_filename = $active_theme . '.sass.css';
_bootstrap4_sass_compile($cssFilename);
foreach (array_keys($css) as $original_css) {
if (strpos($original_css, 'bootstrap4/css/bootstrap4.sass.css') > 0) {
if (isset($css[$originalCss])) {
$css[$cssPath . '/' . $cssFilename] = $css[$originalCss];
$css[$cssPath . '/' . $cssFilename]['data'] = $cssPath . '/' . $cssFilename;
_bootstrap4_sass_compile($css_filename);
unset($css[$originalCss]);
if (isset($css[$original_css])) {
$css[$css_path . '/' . $css_filename] = $css[$original_css];
$css[$css_path . '/' . $css_filename]['data'] = $css_path . '/' . $css_filename;
unset($css[$original_css]);
}
break;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment