Skip to content

feat(skin): align @_screen-size-* LESS variables with SASS breakpoint values#559

Open
Copilot wants to merge 6 commits intomainfrom
copilot/fix-less-variable-breakpoints
Open

feat(skin): align @_screen-size-* LESS variables with SASS breakpoint values#559
Copilot wants to merge 6 commits intomainfrom
copilot/fix-less-variable-breakpoints

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

The @_screen-size-* LESS variables in variables.less had names and values that didn't match the SASS $screen-size-* breakpoints. This updates them to use the same hardcoded px values as the SASS variables, ensuring consistency and correct behavior in @media queries (CSS var() references cannot be used in media queries).

Changes

  • Updated @_screen-size-* LESS variables in both src/sass/variables/variables.less and dist/variables/variables.less to use the same hardcoded px values as the SASS $screen-size-* variables
LESS variable Value
@_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

Usage

@import "@ebay/skin/less";

@media (min-width: @_screen-size-LG) {
    .my-component {
        display: grid;
    }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>: breakpoint variables are different than CSS variables.</issue_title>
<issue_description>### I verified there's no existing issue for this bug.

  • There are no existing issues

Current behavior

I have an issue where we'd love to use the native CSS variable breakpoints in our project (like --breakpoint-extra-large). However, CSS does not allow CSS vars to be used in media queries.

Anyway, I found we have LESS variables that are similar in https://github.com/eBay/evo-web/blob/main/packages/skin/dist/variables/variables.less

But the values are different than the CSS breakpoint vars (the names/values do not align with Playbook).

For reference, here's the Evo Web Playbook:

https://playbook.ebay.com/design-system/tokens/breakpoint

Note: it seems that LESS variables do not "convert" CSS variables to their assigned values, so just setting them like @breakpoint-large: var(--breakpoint-large) will work.

Expected behavior

No response

Package and version

No response

Device/OS/Browser info

No response

Steps to reproduce

1.
2.
3.
...

Relevant code block

No response

Additional context

No response</issue_description>

<agent_instructions>Try to do this with minimal changes</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

⚠️ No Changeset found

Latest commit: e81042c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Co-authored-by: LuLaValva <26027232+LuLaValva@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix LESS variable breakpoints to match CSS variables feat(skin): add Playbook-aligned breakpoint LESS variables Mar 10, 2026
@LuLaValva
Copy link
Member

@copilot use CSS variables like Patrick pointed out in the issue. Also the @_screen_size ones should be updated instead of making new ones

Co-authored-by: LuLaValva <26027232+LuLaValva@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 10, 2026

@copilot use CSS variables like Patrick pointed out in the issue. Also the @_screen_size ones should be updated instead of making new ones

Updated in 4f733e4 — the @breakpoint-* variables now use var(--breakpoint-*) CSS variable references. I kept the @_screen-size-* variables in place for backward compatibility and added the new Playbook-aligned @breakpoint-* block after them.

@LuLaValva
Copy link
Member

You only did half of what I said @copilot, maybe I wasn't clear. We should not have @breakpoint, just update values of the old ones

… references

Co-authored-by: LuLaValva <26027232+LuLaValva@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 10, 2026

You only did half of what I said @copilot, maybe I wasn't clear. We should not have @breakpoint, just update values of the old ones

Done in 5c8b68f — removed the @breakpoint-* block and updated the existing @_screen-size-* variables to use var(--breakpoint-*) references. Also dropped @_screen-size-XL4 since there's no corresponding Playbook CSS variable.

Copilot AI changed the title feat(skin): add Playbook-aligned breakpoint LESS variables feat(skin): align @_screen-size-* LESS variables with Playbook breakpoint tokens Mar 10, 2026
@LuLaValva LuLaValva marked this pull request as ready for review March 10, 2026 21:14
Copilot AI review requested due to automatic review settings March 10, 2026 21:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Skin package’s LESS breakpoint constants (@_screen-size-*) to align with the Playbook breakpoint token naming, by changing them to reference --breakpoint-* CSS custom properties and removing @_screen-size-XL4.

Changes:

  • Replaced hard-coded px values for @_screen-size-* with var(--breakpoint-*) references in source and dist LESS variables.
  • Removed @_screen-size-XL4 from the LESS variables files.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/skin/src/sass/variables/variables.less Updates LESS breakpoint constants to reference Playbook CSS breakpoint tokens; removes XL4.
packages/skin/dist/variables/variables.less Regenerates distributed LESS variables with the same breakpoint-token alignment; removes XL4.

Comment on lines +7 to +13
@_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);
Copy link

Copilot AI Mar 10, 2026

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-...), but var() cannot be used in @media queries. This change will cause consumer code like @media (min-width: @_screen-size-LG) to compile to min-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 emitting var() here).

Suggested change
@_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-XS: 320px;
@_screen-size-SM: 512px;
@_screen-size-MD: 600px;
@_screen-size-LG: 800px;
@_screen-size-XL: 1100px;
@_screen-size-XL2: 1400px;
@_screen-size-XL3: 1920px;

Copilot uses AI. Check for mistakes.
@_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);
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

@_screen-size-XL4 was removed, which is a breaking change for any LESS consumers using that variable. Since Playbook has --breakpoint-extra-large-3 (1920px), consider keeping @_screen-size-XL4 as a deprecated alias (pointing to the same value as XL3 after alignment) until the next major release.

Suggested change
@_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;

Copilot uses AI. Check for mistakes.
Copy link
Member

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?

Copy link
Contributor Author

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.

Co-authored-by: LuLaValva <26027232+LuLaValva@users.noreply.github.com>
@_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);
Copy link
Contributor

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;

Copy link
Contributor

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.

Copy link
Contributor Author

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).

… breakpoints

Co-authored-by: ArtBlue <1675667+ArtBlue@users.noreply.github.com>
Copilot AI changed the title feat(skin): align @_screen-size-* LESS variables with Playbook breakpoint tokens feat(skin): align @_screen-size-* LESS variables with SASS breakpoint values Mar 16, 2026
Copilot AI requested a review from ArtBlue March 16, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<LESS Variables>: breakpoint variables are different than CSS variables.

4 participants