expected "indent", got "outdent"
Asked Answered
Y

2

14
  ParseError: /Users/JMiller/Projects/multisport-momentum/public/stylesheets/style.styl:15

  11|     color #031634
  12| }
  13| a {
  14|     color font.color
> 15|     text-decoration none
  16| }
  17| 
  18| .header

  expected "indent", got "outdent"

What does this mean? It has something to do with whitespace? What whitespace? How do I fix this?

Yolanda answered 22/3, 2012 at 1:23 Comment(6)
Check the values of the whitespace before color and text-decoration -- perhaps one uses tabs and the other uses spaces. xxd style.styl is one useful tool; if you use vim or MacVim, you can also use :set list to see special characters formatted differently.Copy
Both are tabs. I have 'show whitespace' turned on in WebStorm. No dice. Any other suggestions? I'm about to abandon this and try something like sass since this isn't productive for me.Yolanda
What's font.color? I'm not sure, but I don't think . is allowed in variable names. That said, please stay with stylus, it's really quite nice. ;)Ulphi
This definitely has to do with whitespace. I get the idea that the problem may not be line 15. Possible to share more of your .styl file?Sheaves
@EricWendelin: not true, I get the same error with just the a { ... } from poster. Renaming font.color fixes it.Ulphi
@LinusGThiel good call. I've never seen it "not" be whitespace until now, but then again I never tried non-alphanumeric variable names. Thanks for setting it straight :)Sheaves
U
11

The problem here is error reporting more than anything else. Dots . are not allowed in stylus variable names (nor mixin names), so renaming font.color to e.g. font-color will solve your problem.

Ulphi answered 2/4, 2012 at 15:38 Comment(1)
Just a side note: In the case that he was using hashes, which is a feature in stylus, this could actually be valid. If he was declaring it as a hash of course.Thymelaeaceous
C
1

Write property through the colon. For Example:

fontFamily = {
   primary: unquote ("'Open Sans', sans-serif")
}

font-family: fontFamily.primary

WebStorm swears on this syntax. For this to change, add $ before the variable. For Example:

$fontFamily = {
   primary: unquote ("'Open Sans', sans-serif")
}

font-family: $fontFamily.primary
Coop answered 31/7, 2015 at 8:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.