I installed Navbar on my personal website, to start dogfooding it :)

I've already filed issues for the setup problems I encountered. Now I'm running into a different kind of problem: my theme breaks navbar's styling because of:

a {
  border-bottom: 1px solid #93cef4;
}

There are two ways to go about this:

  1. navbar provides "sufficient" styling, and if a theme conflicts with it, it'll just have to add CSS to deal with navbar
  2. navbar gradually "hardens" its CSS to prevent theme CSS from bleeding in; this means that over time, less themes will have to be adjusted for a site to be able to use navbar. The same CSS hardening can be forward-ported to the Drupal 8 version and will therefor benefit all future Drupal 8 sites from the same hardening.

So, it seems like option 2 is the best. Thoughts?

Comments

wim leers’s picture

StatusFileSize
new493.64 KB

Screenshot demonstrating the problem.

jessebeach’s picture

We'll harden the CSS. But it's not going to be pretty :)

jessebeach’s picture

Status: Active » Needs review

Wim, I committed an update (10d34467) with hardened CSS.

Do these changes protect Navbar from your theme?

hass’s picture

wim leers’s picture

Thanks!

I'll test again and report back :)

wim leers’s picture

Status: Needs review » Needs work
StatusFileSize
new314.94 KB

I had to fight through Libraries API hell (see #2167021: Revamp Libraries API integration), but I got it working.

It's much better already now, the only thing that I can see is broken/missing now, is the box-shadow emanating from the tray. So: almost :)

philipz’s picture

The shadow problem looks similar to #2100133: The Toolbar tray box shadow disappears at small viewports sizes on Chrome, on a Mac, under unpredictable conditions. I've applied almost the same fix and the shadow is back too. Does this need a separate issue?

frob’s picture

Status: Needs work » Active

I am marking this as needs review. Basically we need to review the css from Hass' sandbox to see if it salves the problem.

Although, I disagree with this approach -- or maybe I don't know what you mean by "css hardening"
Ideally the nav bar would have classes that would allow sufficient styling and maintain the least logical specificity. this way it would be easier for a theme to override the styling of the navbar if it needed to.

hass’s picture

@Frob: do not forget the real source of all these issues - #2119989: Add navbar_menu_tree() to prevent theme clashes.

frob’s picture

@hass, Good point. Lets solve that one first.

hass’s picture

Please help reviewing the other root case issue.

hass’s picture

Category: Support request » Bug report

Just checked the code http://cgit.drupalcode.org/navbar/tree/css/navbar.theme.css#n23 and I see this a border is an in-depended issue. We could harden this here in navbar, but I also think we cannot harden everything. Some things need to be moved to themes that create the issue.

It looks like core http://cgit.drupalcode.org/drupal/tree/core/modules/toolbar/css/toolbar.... has the same issue. I think we need to harden core first, than backport.

hass’s picture

Title: CSS hardening? » CSS hardening
Project: Navbar » Drupal core
Version: 7.x-1.x-dev » 8.0.x-dev
Component: Code » toolbar.module
Issue tags: +Needs backport to 7.x

Moving to D8. Please move back to navbar once done.

xjm’s picture

Issue tags: -Needs backport to 7.x +Needs backport to D7

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

nod_’s picture

Version: 8.8.x-dev » 9.1.x-dev

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

stefdewa’s picture

Issue tags: +Bug Smash Initiative

I don't think this issue is relevant for Drupal 9 (or 8 for that matter) because:

Perhaps this can be set to "Closed (outdated)".

Anyone care to chime in?

stefdewa’s picture

Status: Active » Closed (outdated)
Issue tags: +ddd2022

Feel free to reopen if still valid.