Problem/Motivation

The toolbar menu's alignment seems to be broken now. When resizing the browser window from wide to narrow, or loading Drupal on a mobile device there seems to be a fixed width on the toolbar container, it does not span 100% width as expected.

Proposed resolution

Create a patch in the toolbar module to have the toolbar width at 100% on mobile devices.

Remaining tasks

Write a patch.
Add screenshots to show what the patch does.
Code review - check the code meets standards and is in the right place in Core.
Visual review + screenshots - to show the patch fixes the problem correctly and does not introduce any regressions.

User interface changes

API changes

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because the toolbar does not visually act as you expect
Issue priority Not critical because the toolbar is still functional as is.
Unfrozen changes Unfrozen because it's a visual fix that only changes CSS.

Comments

wim leers’s picture

I pinged LewisNyman to get his feedback. While definitely inconsistent with Seven and different from Bartik in earlier versions (beta 3), I'm not sure how big a problem this really is. Are there actually users going to resize to such incredibly narrow sizes? (It's more narrow than 320px.)

tom verhaeghe’s picture

Are there actually users going to resize to such incredibly narrow sizes? (It's more narrow than 320px.)

There are quite a lot of mobile devices with tiny screens, e.g. Samsung Galaxy Mini (240x320), but there's more here :-)

wim leers’s picture

Fair enough :)

DickJohnson’s picture

Assigned: Unassigned » DickJohnson
DickJohnson’s picture

On howitshouldbe.mov it is shown that active menu should push content down. By current situation we don't have anything like that in core. It of course can be done like that, but guys like LewisNyman, emma.maria or WimLeers could throw their opinions around if this is the best approach. Also, if that is done, should it start from <601px instead of something below 320px.

lewisnyman’s picture

On howitshouldbe.mov it is shown that active menu should push content down. By current situation we don't have anything like that in core.

It should not push content down, but it makes sense for it to overlay 100% of the screen when the screen is so narrow that nothing useful can be shown.

DickJohnson’s picture

Yup, that's exactly what I thought. Will add an patch today.

DickJohnson’s picture

StatusFileSize
new81.67 KB
new38.79 KB
new49 KB
new58.06 KB
new468 bytes

Ok. So on 608px both navigation and sidebars are hiddened by toolbar-menu for some pixles and at least for me there ux problems are starting, so decided to write the patch to 609px. Spend lot of time thinking between current height and between height: auto. Decided to go with current height so that the menu is taking control of the whole screen.

I think that there should be some discussion on the admin toolbar responsiveness generally as it's acting is quite weird.

Patch and few screenshots as attachments.
608px before and after:
608px before
608px after

263px before and after:
263px before
263px after

lewisnyman’s picture

Assigned: DickJohnson » Unassigned
Status: Active » Needs review
Issue tags: +frontend, +CSS

Status: Needs review » Needs work

The last submitted patch, 8: toolbar-menu-fills-whole-browser-2382561-8.patch, failed testing.

DickJohnson’s picture

CSS -> SMACSS split made this patch to fail. Rerolling in few hours.

DickJohnson’s picture

Status: Needs work » Needs review
StatusFileSize
new443 bytes

New patch around.

emma.maria’s picture

Issue tags: +Needs screenshots

This issue needs the following:

A Beta evaluation added to the issue summary.
A code review of the patch.
A visual review + screenshots to show what the patch affects.

emma.maria’s picture

Title: In narrow viewports the toolbar menu fill up the whole browser width. » In narrow viewports the toolbar menu should be 100% width.
Component: Bartik theme » toolbar.module
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Needs screenshots
StatusFileSize
new187.02 KB

Whilst reviewing this I noticed that actually the toolbar behaves the same in Seven and Bartik at head. See screenshots...

Therefore it does not make sense to add this just to Bartik, we would need to add it to each theme or it will be inconsistent. It makes sense to add this fix to the toolbar module. People now expect menus to be 100% width on mobile devices, and people will want this out the box for any theme default or contrib.

Moving to toolbar module, a new patch is needed, feel free to tell me otherwise :)

sabreena’s picture

Status: Needs work » Needs review
StatusFileSize
new455 bytes
new59.8 KB
new50.51 KB
new47.15 KB
new46.03 KB

For narrow viewports, added 100% width for toolbar menu and making it generic by placing it in toolbar module.
Attaching screenshots and patch (toolbar-menu-for-narrow-viewports-2382561-15.patch).

aliyakhan’s picture

Status: Needs review » Needs work
StatusFileSize
new23.11 KB
new31.15 KB

Width looks perfect, however hover state require little work. Attached shots

aliyakhan’s picture

Status: Needs work » Reviewed & tested by the community

The above thing has been fixed in other issue.Here's the link https://www.drupal.org/node/2409427
So it is good to go.

wim leers’s picture

Title: In narrow viewports the toolbar menu should be 100% width. » In narrow viewports (<320px), the toolbar menu tray should be 100% width
Status: Reviewed & tested by the community » Needs work

Please see #1 & #2 — this was intended only for extremely narrow viewports!

We don't want this on e.g. iPhones.

lewisnyman’s picture

+++ b/core/modules/toolbar/css/toolbar.menu.css
@@ -34,6 +34,13 @@
+/* ----- Toolbar menu for small screens ------ */
+@media screen and (max-width: 609px) {
+  .toolbar .toolbar-tray-vertical.active {
+    width: 100%;
+  }
+}

Here are are undoing CSS that was already set somewhere else, the default width of a div is 100%.

See line 140 of toolbar.module.css:

.toolbar-oriented .toolbar-tray-vertical {
  left: -100%; /* LTR */
  position: absolute;
  width: 240px;
  width: 15rem;
}

If we wrap the width properties in a min-width media query then we wouldn't have to override it later. I think the value that Wim is looking for is min-width: 321px

aliyakhan’s picture

StatusFileSize
new96 KB

As far as i understand it, @Wim @Lewis extremely narrow viewports is <320px where the toolbar should be of 100% width. And leave rest resolutions as it is? Also looks like 320px screen resolutions looks ok. Attached a shot. Will add patch accordingly.

wim leers’s picture

I wrote #18 after having looked at the #15 screenshots, which show something else than #20. Confused now. Once there's a NR patch again, I'll test locally.

sabreena’s picture

@Lewis - Wrapping the width properties in a min-width media query at line 140 in toolbar.module.css doesn't seem to be feasible for viewports < 264px. At this breakpoint toolbar-oriented class is removed, also if we add min-width media query as:
@media screen and (min-width: 320px) {
.toolbar-processed .toolbar-tray-vertical { width: 240px; width: 15rem; }
}
toolbar tray doesn't span 100% width below 264px by default.

Added a new patch for extremely narrow viewports as per #18.

sabreena’s picture

StatusFileSize
new41.39 KB
new39.66 KB

Updated screenshots for viewport < 320px

sabreena’s picture

Status: Needs work » Needs review
aliyakhan’s picture

Status: Needs review » Reviewed & tested by the community

In case there no further enhancements required, On <320px toolbar expands to 100%.

wim leers’s picture

Looks good :) Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

CSS is not frozen in beta. Committed 02965ca and pushed to 8.0.x. Thanks!

  • alexpott committed 02965ca on 8.0.x
    Issue #2382561 by Sabreena, DickJohnson, aliyakhan, Tom Verhaeghe, emma....

Status: Fixed » Closed (fixed)

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