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

Spurious warnings about layout tokens in calc(-1 * ...). #126

Open
wkeese opened this issue Jun 5, 2024 · 1 comment
Open

Spurious warnings about layout tokens in calc(-1 * ...). #126

wkeese opened this issue Jun 5, 2024 · 1 comment

Comments

@wkeese
Copy link

wkeese commented Jun 5, 2024

Given:

@use "@carbon/layout" as layout;
...
.foo {
  margin-top: calc(-1 * #{layout.$spacing-01});
}

We get the spurious carbon/layout-use error that:

229:15 ⚠ Expected calc of the form calc(P O #{$}) or calc(-1 * #{$}). Where 'P' is in (vw, vh or %), 'O' is + or -, '$' is a carbon layout token, mixin or function for "margin-top" found "calc(-1 * #{layout.$spacing-01})".

(In reality, layout.$spacing-01 is a carbon layout token.)

Same spurious error with

.foo {
  margin-top: -#{layout.$spacing-01};
}
@wkeese wkeese changed the title Spurious warnings about layout tokens in calc(). Spurious warnings about layout tokens in calc(-1 * ...). Jun 9, 2024
@lee-chase
Copy link
Member

The scopes functionality is somewhat broken, thanks for raising this issue.

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

No branches or pull requests

2 participants