Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

AaronChristian created an issue. See original summary.

aaronchristian’s picture

Title: Clean up UI for Drupal 9/10 » Clean up UI for 2x branch
aaronchristian’s picture

Title: Clean up UI for 2x branch » 🎨 Clean up UI for 2x branch
aaronchristian’s picture

In Drupal 9/10, our beautiful UI is not so beautiful anymore. 😔

rajab natshah’s picture

Try to do the following
which I learned to make use of that from Gin Layout Builder
doing that in https://git.drupalcode.org/project/varbase_layout_builder/-/blob/10.1.x/...
which works

/**
 * Implements hook_css_alter().
 */
function bootstrap_styles_css_alter(&$css, AttachedAssetsInterface $assets) {

    if (_is_layout_builder_route()) {
    if (\Drupal::service('theme_handler')->themeExists('stable9')) {
      $stable_theme_css = \Drupal::service('extension.list.theme')->getPath('stable9') . '/css';
      unset($css[$stable_theme_css . '/layout_builder/layout-builder.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.theme.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.details.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.reset.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.base.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.table.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.tabledrag.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.form.css']);
      unset($css[$stable_theme_css . '/core/dialog/off-canvas.button.css']);
    }

    unset($css['core/misc/dialog/off-canvas/css/reset.css']);
    unset($css['core/misc/dialog/off-canvas/css/wrapper.css']);
    unset($css['core/misc/dialog/off-canvas/css/titlebar.css']);
    unset($css['core/misc/dialog/off-canvas/css/dropbutton.css']);
    unset($css['core/misc/dialog/off-canvas/css/messages.css']);
    unset($css['core/misc/dialog/off-canvas/css/details.css']);
    unset($css['core/misc/dialog/off-canvas/css/form.css']);
    unset($css['core/misc/dialog/off-canvas/css/button.css']);
    unset($css['core/misc/dialog/off-canvas/css/base.css']);
    unset($css['core/misc/dialog/off-canvas/css/table.css']);
    unset($css['core/misc/dialog/off-canvas/css/utility.css']);
    unset($css['core/misc/dialog/off-canvas/css/drupal.css']);
    // unset($css['core/misc/dialog/off-canvas/css/tabledrag.css']);
    // unset($css['core/misc/dialog/off-canvas/css/throbber.css']);

    if (\Drupal::service('theme.manager')->getActiveTheme()->getName() !== \Drupal::config('system.theme')->get('admin')) {
      unset($css['core/modules/layout_builder/css/off-canvas.css']);
    }
 
  }
}

/**
 * Returns true if the current route is a layout builder route.
 *
 * @return bool
 *   Returns true for layout builder routes.
 */
function _is_layout_builder_route() {
  $layout_builder_route = drupal_static(__FUNCTION__);
  if ($layout_builder_route !== NULL) {
    return $layout_builder_route;
  }

  $route_name = \Drupal::routeMatch()->getRouteName();
  $layout_builder_route = FALSE;

  if ($route_name !== NULL && preg_match('/^(layout_builder\.([^.]+\.)?)/', $route_name)) {
    $layout_builder_route = TRUE;
  }

  $context = null;
  \Drupal::moduleHandler()->alter('_is_layout_builder_route', $layout_builder_route, $context);
  unset($context);
  return $layout_builder_route;
}


aaronchristian’s picture

Status: Active » Needs review
aaronchristian’s picture

Thanks @rajab

I'm trying hard to ensure BLB/BS doesn't cross pollinate the rest of the UI, proving to be a bit difficult, but I'm not sure that enough of our users are going to know to implement your solution.

I'm hoping @Mahmoud will be able to merge these in soon.

We are using the patches on several production sites right now, so far so good 🤞

marcom2021’s picture

When can we expect for this to be updated?