Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Site] Support dpi > 100% for media queries #567

Merged
merged 1 commit into from
Mar 18, 2019

Conversation

lubber-de
Copy link
Member

@lubber-de lubber-de commented Mar 13, 2019

Description

Using higher Screen-DPI Settings (on Windows) than 100% leads to some possible "floating value pixels" for width like "767.2px"
The current breakpoints for every component are always set in full 1px difference. This creates a uncovered gap between 767 and 767.99 now where no media query covers a different visibility setting making every usually hidden element appear.

Testcase

For simplicity the jsfiddle only covers the grid-element. But the PR just changes the breakpoints so every other element using media queries will get fixed at compile time aswell

Broken

https://jsfiddle.net/o04hrpfL/1/show

  • Use Windows
  • Set your screen DPI Setting to 125%
  • Use Chrome
  • Resize the screen to 767.2 Pixel (yes, that's possible... just be patient when resizing the window 🙂 )

Fixed

https://jsfiddle.net/o04hrpfL/show

Screenshot

image

Closes

#385

@lubber-de lubber-de added type/bug Any issue which is a bug or PR which fixes a bug lang/css Anything involving CSS state/awaiting-reviews Pull requests which are waiting for reviews labels Mar 13, 2019
@lubber-de lubber-de added this to the 2.7.4 milestone Mar 13, 2019
Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@prudho prudho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami merged commit c55eb51 into fomantic:develop Mar 18, 2019
@lubber-de lubber-de modified the milestones: 2.7.4, 2.7.3 Mar 18, 2019
@lubber-de lubber-de removed the state/awaiting-reviews Pull requests which are waiting for reviews label Mar 18, 2019
@lubber-de lubber-de deleted the fix/385/respect_dpi_edges branch March 18, 2019 11:14
@y0hami y0hami mentioned this pull request Apr 1, 2019
y0hami pushed a commit that referenced this pull request Apr 26, 2019
Especially recognized in table or grid elements a breakpoint wasn't correctly fetched by the browsers, because the floating max value covers a 0.99 of the "before pixel" (was implemented by #567)
While mathematically correct, it was not working on the browser to correctly recognize the next full pixel again. (768 pixel were still recognized as something below)
I found out that it was working again when we'll use 0.98 of the breakpoint pixel (instead of 0.99.
This way the dpi fix of #567 still works but also fixes #681 now.
While i was testing with different dpi settings and windows resizings, i never came across a value of xxxx.99, so xxxx.98 as a breakpoint should fix both issues now.

Closes #681
exoego pushed a commit to exoego/Fomantic-UI that referenced this pull request Apr 30, 2019
Especially recognized in table or grid elements a breakpoint wasn't correctly fetched by the browsers, because the floating max value covers a 0.99 of the "before pixel" (was implemented by fomantic#567)
While mathematically correct, it was not working on the browser to correctly recognize the next full pixel again. (768 pixel were still recognized as something below)
I found out that it was working again when we'll use 0.98 of the breakpoint pixel (instead of 0.99.
This way the dpi fix of fomantic#567 still works but also fixes fomantic#681 now.
While i was testing with different dpi settings and windows resizings, i never came across a value of xxxx.99, so xxxx.98 as a breakpoint should fix both issues now.

Closes fomantic#681
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/css Anything involving CSS type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants