storybook-design-token icon indicating copy to clipboard operation
storybook-design-token copied to clipboard

Tokens parsing can't find the end if the new token starts after a closing curly brace

Open DaveMBush opened this issue 2 years ago • 1 comments

I have code similar to

:root {
  /**
     * @tokens Base-Colors
     * @presenter Color
     */
  --grey1100: rgb(26, 28, 32);
  --grey1000: (42, 46, 52);  
}

body.theme-dark {
  /**
    * @tokens Dark-Colors
    * @presenter Color
    */
  --cu-background-app-background: rgb(var(--_cu-grey1000));
  --cu-background-app-background-inverse: rgb(var(--_cu-white));
}

When this is parsed, the parser can't find the end of Base-Colors so the Dark-Colors are included in the Base-Colors render block.

I've gotten around this by placing

  /**
  * @tokens End-Base-Colors
  * @presenter Color
  */

Right before the closing curly brace.

DaveMBush avatar May 05 '22 22:05 DaveMBush

Thanks for reporting. I'll look into it.

Sqrrl avatar Jun 28 '22 12:06 Sqrrl

Hey. Should be fixed with v2.7.0.

Sqrrl avatar Sep 16 '22 13:09 Sqrrl