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

Apache License 2.0
9 stars 3 forks source link

Incorrect auto-fix for spacing tokens #125

Closed wkeese closed 2 months ago

wkeese commented 3 months ago

The auto-fix converts

padding-left: 16px;

to

padding-left: type.$spacing-05

It should convert to:

padding-left: layout.$spacing-05

This is assuming that you've done an import like

@use "@carbon/layout" as layout;

or

@use "@carbon/layout";

The conversion would be different if the application imported the layout tokens without a namespace:

@use "@carbon/layout" as *;

or if the application imported carbon in such a way that all the symbols are smushed into the same namespace, for example

@use "@carbon/styles" as styles;