Skip to content

Commit cf7267e

Browse files
tomrlqannieyw
authored andcommitted
fix(cdk/layout): decrease breakpoint upper bounds (#20866)
The previous breakpoint upper bounds use `.99` for the fractional components of upper bounds. However, this seems to cause browser to round up to the next pixel, creating an overlap for these values. Changing to `.98` fixes this. Fixes #20850 (cherry picked from commit 16576e4)
1 parent c54a3ac commit cf7267e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/cdk/layout/breakpoints.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
// PascalCase is being used as Breakpoints is used like an enum.
99
// tslint:disable-next-line:variable-name
1010
export const Breakpoints = {
11-
XSmall: '(max-width: 599.99px)',
12-
Small: '(min-width: 600px) and (max-width: 959.99px)',
13-
Medium: '(min-width: 960px) and (max-width: 1279.99px)',
14-
Large: '(min-width: 1280px) and (max-width: 1919.99px)',
11+
XSmall: '(max-width: 599.98px)',
12+
Small: '(min-width: 600px) and (max-width: 959.98px)',
13+
Medium: '(min-width: 960px) and (max-width: 1279.98px)',
14+
Large: '(min-width: 1280px) and (max-width: 1919.98px)',
1515
XLarge: '(min-width: 1920px)',
1616

17-
Handset: '(max-width: 599.99px) and (orientation: portrait), ' +
18-
'(max-width: 959.99px) and (orientation: landscape)',
19-
Tablet: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait), ' +
20-
'(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',
17+
Handset: '(max-width: 599.98px) and (orientation: portrait), ' +
18+
'(max-width: 959.98px) and (orientation: landscape)',
19+
Tablet: '(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), ' +
20+
'(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)',
2121
Web: '(min-width: 840px) and (orientation: portrait), ' +
2222
'(min-width: 1280px) and (orientation: landscape)',
2323

24-
HandsetPortrait: '(max-width: 599.99px) and (orientation: portrait)',
25-
TabletPortrait: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait)',
24+
HandsetPortrait: '(max-width: 599.98px) and (orientation: portrait)',
25+
TabletPortrait: '(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)',
2626
WebPortrait: '(min-width: 840px) and (orientation: portrait)',
2727

28-
HandsetLandscape: '(max-width: 959.99px) and (orientation: landscape)',
29-
TabletLandscape: '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',
28+
HandsetLandscape: '(max-width: 959.98px) and (orientation: landscape)',
29+
TabletLandscape: '(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)',
3030
WebLandscape: '(min-width: 1280px) and (orientation: landscape)',
3131
};

0 commit comments

Comments
 (0)