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:

  • bootstrap_styles-3353004 Comparechanges, plain diff MR !57
  • light-and-gin-fixes Comparecompare
  • 1.2.x Comparecompare
  • 2.0.x Comparecompare
  • 1.0.x Comparecompare

Comments

AaronChristian created an issue. See original summary.

aaronchristian’s picture

Title: Clean up UI for 1x branch » 🎨 Clean up UI for 1x branch
chike’s picture

The MR patch wouldn't apply with Composer and the module wouldn't download from the branch using Composer.

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

@chike from what I can see if you're using D10 you will need a few extra patches;

"drupal/bootstrap_layout_builder": {
                "3335356: Fix Module does not work in D10": "https://www.drupal.org/files/issues/2023-01-25/issue_3335356_drupal10.patch",
                "3335356: Clean up UI for 2x branch": "https://git.drupalcode.org/project/bootstrap_layout_builder/-/merge_requests/24.diff",
                "3279492: Remove no-gutters class from templates.": "patches/bootstrap_layout_builder-remove-no-gutters-class-from-templates-3279492-18.patch"
            },
            "drupal/bootstrap_styles": {
                "3315218: Fix not loading bootstrap_styles/aos.local or bootstrap_styles/aos.remote library.": "https://www.drupal.org/files/issues/2023-01-25/3315218-17--1-0-x.patch",
                "3330458: [Drupal 10] Change of JS jquery/once to drupal core/once, migrate JS API.": "https://www.drupal.org/files/issues/2023-03-07/bootstrap_styles-3330458-8.patch",
                "3282082: Support Bootstrap 5 on bootstrap_styles module.": "https://www.drupal.org/files/issues/2022-06-14/Fix-support-bootstrap-5-on-bootstrap-styles-3282082-%233.patch",
                "3361091: Clean up UI for 1x branch.": "https://git.drupalcode.org/project/bootstrap_styles/-/merge_requests/57.diff"
            },

Hope that helps!

If you're using D9, please give some more specifics on your setup and I'll see if I can assist you further. Please ping me in Slack if you would like quicker support!

chike’s picture

@AaronChristian Thanks I will be checking this out tomorrow.

In D9, I have 'media_library_theme_reset', 'layout_builder_modal' and the regulars. I am using the 'boostrap' Bootstrap 3 theme. The Bootstrap Styles are not looking good at all.

aaronchristian’s picture

Ah okay thanks @chike, we no longer support bootstrap 3, are you able to upgrade to bootstrap 4 or 5?

chike’s picture

The collection of patches cleaned up the UI nicely.

This patch is not online,

 "3279492: Remove no-gutters class from templates.": "patches/bootstrap_layout_builder-remove-no-gutters-class-from-templates-3279492-18.patch"
            },

That's for the D10 site. As for the D9 site using 'bootstrap' theme I think I may have to change the theme to one of the Bootstrap 5 themes as I am not sure 'bootstrap' will be adopting newer Bootstrap versions anytime soon.

pfeiffer’s picture

After applying this patch in a Drupal 9.4 all options of any block or section have a white background color.

carolpettirossi’s picture

StatusFileSize
new489.64 KB

Attached the patch from MR to use in composer

andre.bonon made their first commit to this issue’s fork.

andre.bonon’s picture

StatusFileSize
new489.38 KB

@aaron, we have more issues with the z-index and modals when LB is enabled for other entity types such as Blocks.
I updated the ui-dialog's z-index so as to be the same as Claro's (1260) and pushed it to the MR.
Also, I'm attaching the patch from MR to use in composer.

flyke’s picture

Can this be updated or a new issue fork be created that applies to bootstrap_styles 1.1.5 ?

sim_1’s picture

Status: Needs review » Reviewed & tested by the community

Marking RTBC. Things are pretty broken without this. I'm sure more improvements are needed, but better to have something than keep living with things being broken.

aaronchristian’s picture

Version: 1.1.0 » 1.1.5

@flyke this has been updated with the latest tagged release 1.1.5 now.

carolpettirossi’s picture

Uploading a patch from MR#57.

I tested it on my projects, and it worked as expected.

carolpettirossi’s picture

StatusFileSize
new490.76 KB

Forgot to click "Upload". Sorry about that

guido_s’s picture

Status: Reviewed & tested by the community » Needs work

The branch needs a rebase as the patches don't apply anymore, but it seems this is a little more complicated.
There are conflicts in (s)css files where someone needs to evaluate which changes to keep and trying to use npm install throws errors, so I can't even compile the merged scss.
Maybe someone who has more insight in this issue and has the project set up already can rebase the branch and provide a new patch?

git rebase 1.0.x
Auto-merging css/bs_example_classes/border-classes.css
Auto-merging css/general-styles.css
Auto-merging css/themes/dark.css
CONFLICT (content): Merge conflict in css/themes/dark.css
Auto-merging css/themes/light.css
CONFLICT (content): Merge conflict in css/themes/light.css
Auto-merging scss/general-styles.scss
Auto-merging scss/themes/dialog/components/_off-canvas.inlineblock.scss
CONFLICT (content): Merge conflict in scss/themes/dialog/components/_off-canvas.inlineblock.scss
error: could not apply a0ed6f7... 3353004: Clean up UI for 1x branch.

cassioalmeida made their first commit to this issue’s fork.

cassioalmeida’s picture

StatusFileSize
new381.08 KB

Hi!

I'm using this with Gin, and I found that the Light version was odd, so I fixed some of that. I also added a check to include a gin.css file to work with Gin's accent colors. I'm submitting the patch and I pushed the code to the branch light-and-gin-fixes branch in the issue fork.

cassioalmeida’s picture

StatusFileSize
new51.08 KB
aaronchristian’s picture

Status: Needs work » Needs review
aaronchristian’s picture

I see the patch doesnt apply anymore, i'm working on a fix, should have something in the next few days to clean things back up.

cassioalmeida’s picture

StatusFileSize
new50.95 KB

Hey. I found that for the gin patch, we need to add the weight to apply it properly. I'm just uploading the new patch with it, called gin-weight.patch.

anicoto made their first commit to this issue’s fork.

anicoto’s picture

Version: 1.1.5 » 1.2.x-dev

Working on Module v1.2.1 still have issues with the UI. Branch need rebase

hfernandes’s picture

Honestly, I don't think this module should implement the light/dark modes as it directly impacts the admin theme.
Admin themes like Gin have their own light/dark modes, and overriding them causes a lot of layout issues.

This module CSS should only focus on styling the "Style" tab - which is provided by this module - and inherit any style from the admin/base theme.

rhovland’s picture

Status: Needs review » Needs work

MR now contains out of scope changes.
Adds a license file. Adds stuff to info.yml that shouldn't be there. Adds a patches.txt file. Adds theme specific css and patches.

There is a lot of good work in here too but it's buried in a ton of unrelated changes that belong in their own issues.

rhovland’s picture

After installing 1.2.3 which included the fixes in #3282082: Support for Bootstrap 5; on bootstrap 5 the UI looks fine without any patches.

So this issue may be obsolete unless someone can explain what is still broken in the latest version and how to reproduce it.