Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Sub-Pixel calculation issue #1001

@charsleysa

Description

@charsleysa

Bug Report

What is the expected behavior?

No problems caused by subpixel calculations by browsers.

What is the current behavior?

If the browser ends up with the width of the viewport set to something like 1279.5px then neither the md nor the lg breakpoints match.

What are the steps to reproduce?

Here's a codepen showing the issue using basic CSS but same applies to this library: https://codepen.io/anon/pen/VqoGXP

image

What is the use-case or motivation for changing an existing behavior?

This really starts to apply to higher density screens with scaling turned of (such as a 2160p monitor with Windows set to 150% scaling and using 2 browsers on each half of the screen).

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

All.

Is there anything else we should know?

The fix is pretty simple, just add .9999 to the end of all the pixel values that are 1px less than the next break point (e.g. the md breakpoint max-width would be set to 1279.9999px).

Metadata

Metadata

Labels

P5Low-priority issue that needs considerationdiscussionFurther discussion with the team is needed before proceedinghas prA PR has been created to address this issuehelp wantedThe team would appreciate a PR from the community to address this issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions