carbon-design-system / stylelint-plugin-carbon-tokens

Apache License 2.0
9 stars 3 forks source link

Spurious warnings about motion token uses #127

Closed wkeese closed 2 months ago

wkeese commented 3 months ago

Given SCSS like:

@use "@carbon/motion" as motion;

.foo {
    transition: opacity motion.$duration-fast-02;
}

I get the spurious carbon/motion-duration-use error that:

✖ Expected carbon motion token, mixin or function to be set for variable "motion.$duration-fast-02" used by
"transition" found "an unknown, undefined or unrecognized value".

(AFAICT I am using a carbon motion token.)

Possibly this is related to still being on Carbon 10. We are in the process of upgrading to Carbon 11, but I haven't checked there yet. I remember there being something weird about the number of dashes changing, like $duration--fast-02 --> $duration-fast-02, or vice-versa.

lee-chase commented 2 months ago

In Carbon 10 this should be motion.$duration--fast-02

wkeese commented 2 months ago

Agreed. In any case, we've recentlly upgraded to Carbon 11, and I'm not getting spurious warnings anymore, for example this passes:

@use "@carbon/react/scss/motion" as motion;
...
    transition: width motion.$duration-moderate-02
      motion.motion(standard, expressive);

Not sure if Carbon 10 is working correctly or not but it doesn't seem important since everyone is moving to Carbon 11 now.

So I'm going to close this.