-
Notifications
You must be signed in to change notification settings - Fork 34
feat(skin): align @_screen-size-* LESS variables with Playbook breakpoint values #559
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
18ce8c7
ebc0020
4f733e4
5c8b68f
057fb82
e81042c
8efb2af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,14 +4,13 @@ | |||||||||
| // most mobile devices would be higher in screen width than the smallest viewport width. | ||||||||||
|
|
||||||||||
| // The variables with underscores are to be considered constants. They can be read, but should not be modified. | ||||||||||
| @_screen-size-XS: 320px; | ||||||||||
| @_screen-size-SM: 512px; | ||||||||||
| @_screen-size-MD: 768px; | ||||||||||
| @_screen-size-LG: 1024px; | ||||||||||
| @_screen-size-XL: 1280px; | ||||||||||
| @_screen-size-XL2: 1440px; | ||||||||||
| @_screen-size-XL3: 1680px; | ||||||||||
| @_screen-size-XL4: 1920px; | ||||||||||
| @_screen-size-XS: var(--breakpoint-extra-small); | ||||||||||
| @_screen-size-SM: var(--breakpoint-small); | ||||||||||
| @_screen-size-MD: var(--breakpoint-medium); | ||||||||||
| @_screen-size-LG: var(--breakpoint-large); | ||||||||||
| @_screen-size-XL: var(--breakpoint-extra-large); | ||||||||||
| @_screen-size-XL2: var(--breakpoint-extra-large-2); | ||||||||||
| @_screen-size-XL3: var(--breakpoint-extra-large-3); | ||||||||||
|
||||||||||
| @_screen-size-XL3: var(--breakpoint-extra-large-3); | |
| @_screen-size-XL3: var(--breakpoint-extra-large-3); | |
| // Deprecated: alias for @_screen-size-XL3; keep until next major version to avoid breaking LESS consumers. | |
| @_screen-size-XL4: @_screen-size-XL3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh good point, @copilot can you add that one back as a hardcoded value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added back in 057fb82 as @_screen-size-XL4: 1920px.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't look correct. Here is what the SASS breakpoints look like:
$screen-size-XS: 320px;
$screen-size-SM: 512px;
$screen-size-MD: 768px;
$screen-size-LG: 1024px;
$screen-size-XL: 1280px;
$screen-size-XL2: 1440px;
$screen-size-XL3: 1680px;
$screen-size-XL4: 1920px;
$page-grid-max-width: 1584px;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot , the correct breakpoints can be found in this comment: https://github.com/eBay/evo-web/pull/559/changes/5c8b68f04d7133b8025904cd47f8821004f22321..057fb825a63e2d8dec47e8cfe49c31d778fb88ad#r2914611658
Please ensure the less files also use those. If the css props have those values, just use the props. If not, use those values directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in e81042c — the --breakpoint-* CSS custom properties have different values than the SASS breakpoints, so the LESS variables now use the same hardcoded px values as the SASS $screen-size-* variables (320/512/768/1024/1280/1440/1680/1920px).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These LESS breakpoint variables are now set to
var(--breakpoint-...), butvar()cannot be used in@mediaqueries. This change will cause consumer code like@media (min-width: @_screen-size-LG)to compile tomin-width: var(--breakpoint-large)and the media query will never match. To keep LESS breakpoints usable in media queries while aligning with Playbook, set these to the corresponding resolved lengths (e.g., 320px/512px/600px/800px/1100px/1400px/1920px) or generate the LESS values from the token source at build time (but avoid emittingvar()here).