matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Color-hex-case set to upper upper is not applied correctly in mixins #242

Open TabTabTab opened 7 years ago

TabTabTab commented 7 years ago

The stylelint rule color-hex-case is not applied on the base level in mixins. version: 5.0.2

.stylelintrc:

{
    "rules": {
        "color-hex-case": "upper",
    }
}

scss before stylefmt:

$color1: #aaaaaa;

@mixin mix {
  // look what happens to this casing
  color: #aaaaaa;
  font-size: 10PX;

  > .testClass {
    color: #aaaaaa;
  }
}

scss after stylefmt:

$color1: #AAAAAA;

@mixin mix {
  // look what happens to this casing
  color: #aaaaaa;
  font-size: 10PX;

  > .testClass {
    color: #AAAAAA;
  }
}
shotasenga commented 7 years ago

Same problem happens in SASS's map definisions.

.stylelintrc

{
  "rules": {
      "color-hex-case": "upper",
  }
}

source scss file

$colors: (
  facebook: #3b5998,
  twitter: #1da1f3
);

$color-variable: #ddd;

.example {
  color: #fff;
}

result

$colors: (
  facebook: #3b5998,
  twitter: #1da1f3
);
$color-variable: #DDD;

.example {
  color: #FFF;
}