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

Don't merge prop names in different categories #131

Open
schmuli opened this issue Dec 18, 2017 · 1 comment
Open

Don't merge prop names in different categories #131

schmuli opened this issue Dec 18, 2017 · 1 comment

Comments

@schmuli
Copy link

schmuli commented Dec 18, 2017

When importing a few files, any prop names that repeat will be overwritten.

The Issue

Given a set of files:

# margins.yml

props:
  - name: auto
    value: auto
  - name: px
    value: 1px
  - name: 1
    value: 0.25rem

global:
  category: margins
  type: length


# paddings.yml

props:
  - name: px
    value: 1px
  - name: 1
    value: 0.25rem

global:
  category: paddings
  type: length


# dimensions.yml

imports:
  - "./margins.yml"
  - "./paddings.yml"

Expected Output

When converting dimensions.yml, using a slightly modified map.scss format that groups by cateogry instead of file-name, I expect to see:

// spacings.scss

$margins: (
    'auto': (auto),
    'px': (1px),
    '1': (0.25rem)
);

$paddings: (
    'px': (1px),
    '1': (0.25rem)
);

Actual Output

Instead I'm seeing:

// spacings.scss

$margins: (
    'auto': (auto)
);

$paddings: (
    'px': (1px),
    '1': (0.25rem)
);

In other words, the repeated prop names ("px" and "1") are omitted from the $margins map.

Rationale

Since I'm using SCSS maps, I don't need to prefix the name of the token with the category, however this means that between categories I am reusing the same name.

@trazek
Copy link
Contributor

trazek commented Nov 14, 2018

I can confirm this is happening. Will take a look

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