Comments

mkrkarthi created an issue. See original summary.

georgebrook’s picture

Assigned: Unassigned » georgebrook
Status: Active » Needs review
StatusFileSize
new1.86 KB

I have noticed that in the page.tpl.php for the Drupal 7's bootstrap there is a container wrapping the contents of the header which adds a padding to eaither side of the navbar. A similar effect can be seen here: https://getbootstrap.com/examples/navbar/ Not sure if there was a reason to remove this container wrapper but I have created a patch which adds this and seems to safely fix the issue.

This is my first patch and contribution to Drupal so be nice :)

markhalliwell’s picture

Status: Needs review » Needs work
Related issues: +#2452703: Containers (`.container` and `.container-fluid`) are not nestable

IIRC, I was attempting to deal with this related issue.

I'm not entirely sure a container wrapper is necessary. It's probably some CSS override stuff that is causing it?

georgebrook’s picture

StatusFileSize
new3.88 KB

Yes, the only declalred CSS rule I could find was the negative 15px margin on .navbar-right which, when removed, and without the container wrapper, looks like this.. (attached)

markhalliwell’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2684413: Fluid Container no longer work correctly
markhalliwell’s picture

Status: Closed (duplicate) » Needs work

Oops, wrong status.

markhalliwell’s picture

Component: CSS Overrides » Templates
Assigned: georgebrook » Unassigned
+++ b/templates/system/page.html.twig
@@ -73,25 +73,27 @@
+      <div class="{{ container }}">
...
       </div>

This wrapper should only show up if anything but the "normal" navbar position is used, otherwise we reintroduce the issue in #2452703: Containers (`.container` and `.container-fluid`) are not nestable.

Furthermore, the LESS overrides for this also need to be removed in the patch.

markhalliwell’s picture

Bump

jorgediazhav’s picture

Status: Needs work » Needs review
StatusFileSize
new1.1 KB

The problem is a Toolbar Module specific CSS behaviour on mobile.

This patch is for the overrides /css folder. I made all changes on the /starterkits/less/less/component/navbar.less

I have tested this fix on Firefox 47.x and Chrome 51 with:

- Fixed Top Navbar.
- Fixed Bottom Navbar.

Please review guys!

jorgediazhav’s picture

Status: Needs review » Needs work

Oops my bad, I mixed 2 different issues. Sorry :(

Forget this patch, it doesn't belong here.

toomanypets’s picture

Here is a revised patch per markcarver's comments in #7.

toomanypets’s picture

StatusFileSize
new2.15 KB

Fixed file name.

Edit: Actually, I made it worse. Files are identical. I need coffee.

toomanypets’s picture

Status: Needs work » Needs review
markhalliwell’s picture

Status: Needs review » Needs work
+++ b/themes/bootstrap/templates/system/page.html.twig
@@ -68,23 +68,29 @@
+      {% if not ('container' in navbar_attributes.storage.class) %}
...
+      {% if not ('container' in navbar_attributes.storage.class) %}

This is overly complicated and gets into the internal mechanisms of the Attribute class. It can simply be written like the following so it uses the available helper method:

{% if navbar_attributes.hasClass('container') %}

---

Furthermore, my comments about needing to remove the LESS overrides have gone unnoticed.

toomanypets’s picture

StatusFileSize
new809 bytes

Mark, thanks for the review. I've revised the class test per your comments, but I don't see any LESS overrides in this patch. Please explain. Thanks.

toomanypets’s picture

StatusFileSize
new1.67 KB

These bits are still required when navbar position is Normal, otherwise the navbar is a tad too wide:

http://cgit.drupalcode.org/bootstrap/tree/starterkits/less/less/componen...
http://cgit.drupalcode.org/bootstrap/tree/starterkits/sass/sass/componen...

The other bits have been removed; there is never a case where we'll have a container within a container.

I tested by transpiling the modified LESS code. I did not test the modified SASS code. Patch consists of #15 plus LESS/SASS changes.

toomanypets’s picture

Status: Needs work » Needs review

  • markcarver committed 17e6346 on 8.x-3.x authored by toomanypets
    Issue #2652098 by toomanypets, georgebrook, jorgediazhav: User menu...
  • markcarver committed e623ceb on 8.x-3.x
    Automated commit: grunt compile (CSS)
    
    Issue #2652098 by toomanypets,...
markhalliwell’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.