small screens, fixed toolbar and media queries

Created on 29 September 2016, about 8 years ago
Updated 25 August 2023, about 1 year ago

I had a problem with the toolbar menu making my site body smaller at smaller screen sizes. So if I've made my responsive theme according to screen size then after logging in and at certain screen sizes the layout would be too narrow and I would have to add more complexity to my css. Trying to find the easy way (do the responsive css once) I wanted to just force the theme to mobile if that vertical menu is active. I've done this by adding a class - toolbar-vertical-not-forced-fixed - to body (both js and html.html.twig) that is only active if the screen is not at the problematic size. My css looks like this

// Mobile first.
body {
  background: red;
}

.toolbar-vertical-not-forced-fixed {
  // Tablet
  @media ...

  // Desktop
  @media ...
}

So if the vertical menu is active then the site is always in mobile state.

✨ Feature request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
ToolbarΒ  β†’

Last updated about 11 hours ago

  • Maintained by
  • πŸ‡«πŸ‡·France @nod_
Created by

πŸ‡ͺπŸ‡ͺEstonia hkirsman

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024