ThisIsManta / stylus-supremacy

A Node.js script that helps formatting Stylus files.
https://thisismanta.github.io/stylus-supremacy
MIT License
88 stars 9 forks source link

Wrong work with stylus `property lookup` feature and `sortProperties: 'grouped' ` #29

Closed zoxon closed 6 years ago

zoxon commented 6 years ago

config.json

{
  "insertColons": false,
  "insertSemicolons": false,
  "insertBraces": false,
  "insertParenthesisAroundIfCondition": false,
  "selectorSeparator": "\n",
  "quoteChar": "'",
  "sortProperties": "grouped",
  "alwaysUseImport": true,
  "alwaysUseNoneOverZero": true,
  "reduceMarginAndPaddingValues": true,
  "ignoreFiles": ["gulp/**/icons-template.styl"]
}

input.styl

$stars-count = 5

.star-rating
    height 30px
    width @height * $stars-count

output.styl

$stars-count = 5

.star-rating
    width @height * $stars-count // Error: cannot perform null * (5)
    height 30px
ThisIsManta commented 6 years ago

I think you should avoid using sortProperties, or replace @height with a variable. I cannot think of any solution.

ThisIsManta commented 6 years ago

Closed due to no activities.