question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS Visibility (and QLayout) media-queries min/max bug

See original GitHub issue

Describe the bug The CSS visibility utils like lt- and gt- are using $breakpoint-[...]-max as max-width @media query. However, max-width works like <max-width, and not like <=max-width. As the min-width is previous-max-width plus 1px, there falls a gap of 1px between max and min.

This results in inconsistent behaviour on some specific screen sizes (599, 1023, 1439, 1919) where no display: none will apply. Also, when resizing the window it is worth noting that the layout ‘flickers’ when passing the given screen sizes.

Codepen/jsFiddle/Codesandbox (required) https://jsfiddle.net/y4t86sgx/3/

To Reproduce Steps to reproduce the behavior:

  1. Go to https://jsfiddle.net/y4t86sgx/3/show
  2. Open dev tools > device emulation / reponsive design-modus (CTRL+SHIFT+M)
  3. Change device width to 599, 1023, 1439 or 1919px
  4. Notice that given classes are not using the correct max-width

Expected behavior There are two solutions; Make $breakpoint-[...]-max same as $breakpoint-[...+1]-min Or Change lt-, gt- and q-layout-padding to use $breakpoint-[...+1]-min as max-width

Screenshots image

Platform (please complete the following information): Quasar Version: 2.0.0 @quasar/app Version: n/a

Quasar mode: modes where CSS classes are used

  • SPA
  • SSR
  • PWA
  • Electron
  • Cordova
  • Capacitor
  • BEX

Tested on:

  • SPA
  • SSR
  • PWA
  • Electron
  • Cordova
  • Capacitor
  • BEX

OS: Windows 10 Home Node: 14.15.4 NPM: 7.18.1 Yarn: 1.22.10 Browsers: Edge 91.0.864.59, Firefox 89.0.2 iOS: Absolutely not Android: 11 Electron: -

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
rstoenescucommented, Dec 27, 2021

Enhancement will be available in Quasar v2.4.2 and v1.17

1reaction
pdanpdancommented, Dec 26, 2021

ok, we (you) found the problem - I’ll take a look at the fix 😃 thank you for the help in identification

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug with browsers' interpretation of @media queries
This means there can be instances where the recalculated/changing size fall between e.g. max-width:719px nor min-width:720px . In this case it ...
Read more >
Using media queries - CSS: Cascading Style Sheets | MDN
Combining multiple types or features · (min-width: 30em) and (orientation: landscape) ; Testing for multiple queries · (min-height: 680px), screen ...
Read more >
Mistakes that you make in CSS media query. - Dev Genius
Breakpoint is ratio of width and height which we declare in media query. Let's look at basic media queries. @media screen and (max-(width/height):...
Read more >
CSS Media Min-Width & Max-Width Queries - How They Work
Media queries can be used to target certain resolutions or even specific email clients and can replace or work alongside fluid hybrid design....
Read more >
Responsive Layouts, Fewer Media Queries | CSS-Tricks
We can use max(400px, 100%/(N + 1) + 0.1%) . The logic is: we tell the browser that each item has a width...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found