stylelint-config-sass-guidelines icon indicating copy to clipboard operation
stylelint-config-sass-guidelines copied to clipboard

Order `dollar-variables` should always come first

Open dannobytes opened this issue 3 years ago • 1 comments
trafficstars

For SCSS users, sometimes we need to assign custom CSS properties to SCSS variables, which requires those variables be defined before custom properties are. But with the current ordering, this is impossible.

div {
  $color: blue;

  // Throws an error saying this should be placed above $color.
  --theme-color: #{$color};
}

Can we swap the ordering here of custom-properties and dollar-variables so that variables always come first and before all others?

e.g.

    "order/order": [
      [
        "dollar-variables",
        "custom-properties",
        ...

dannobytes avatar Apr 04 '22 22:04 dannobytes

Or, maybe custom properties should always be encouraged to be used instead of Scss vars? And that's why this ordering is there? 🤔

If that's the case, feel free to close this out and ignore my request.

dannobytes avatar Apr 04 '22 22:04 dannobytes