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

SD 3.0 output references #579

Closed
chemoish opened this issue Mar 25, 2021 · 3 comments
Closed

SD 3.0 output references #579

chemoish opened this issue Mar 25, 2021 · 3 comments

Comments

@chemoish
Copy link

chemoish commented Mar 25, 2021

After following https://amzn.github.io/style-dictionary/#/version_3?id=output-references, I noticed this works most of the time, but for some reason it generates the following scss errors for nested aliased properties. Does the output account for alias dependencies?

This throws a SassError: Undefined variable..

I couldn't find a relating issue, is this a known issue?

Input

Config

files: [
  {
    destination: '_variables.scss',
    format: 'scss/variables',
    options: {
      outputReferences: true,
    },
  },
],

Font

{
  "font": {
    "family": {
      "custom": {
        "value": "'Helvetica Neue', Helvetica, Arial, sans-serif"
      },

      "default": { "value": "{font.family.custom.value}", "themeable": true }
    }
  }
}

Component

{
  "component": {
    "alert": {
      "fontFamily": {
        "value": "{font.family.default.value}",
        "themeable": true
      }
    }
  }
}

Output

_variables.scss

$font-family-custom: 'Helvetica Neue', Helvetica, Arial, sans-serif;
$component-alert-font-family: $font-family-default !default;
$font-family-default: $font-family-custom !default;

$font-family-default is placed at the end of the file, but is used prior to being defined.

@dbanksdesign
Copy link
Member

Ah, it looks like in the scss/variables format we are sorting all the tokens to make sure references are at the end, but not accounting for nested references... We need to fix that somehow

@dbanksdesign
Copy link
Member

This is fixed and will make it out in the next release candidate we will publish this week.

@dbanksdesign
Copy link
Member

Closing this as this should be fixed in the latest release candidate of 3.0.

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