Why isn’t Stylus identifying classes?

Asked

Viewed 52 times

6

I’m having a problem with Stylus. Compiling my code by Node sometimes it gives a bug, it seems that it does not identify the classes because of the . generating the following error:

expected "indent", got "outdent"

Note: There are hours that work and there are hours that do not.

header h1
    font-weight: 500
    margin-bottom: -1em

input, label
    column(12)

input, select
    margin: 0.5em auto 1em auto
    height: 1.8em
    border: solid #ccc 0.1em

button
    margin: 1em
    background-color: ##205FBE
    color: white

.txt-center
    text-align: center
  • 1

    My problem is not that, I’m not naming a variable or a mixin with '.', I just want to use a class...

  • Have you checked if there really are no indented spaces, or have you tried hyphenating instead of dots ?

  • 1

    Tests indent and remove spaces, use the sublime-text for that. Press crt + shift + p and type Indentation: Convert to Spaces , It always helps me with Stylus and also with Jade

  • Thanks @Rubensbarbosa worked!

1 answer

3


What was making him return the error is that there was a space in the middle of tabs.

As I use sublime text, I used @Rubens Barbosa’s tip, I downloaded the command Palette (Ctrl+shift+p):

"Indentation: Convert to Spaces"

And then converted to tabs again.

"Indentation: Convert to Tabs"

Now I will police myself to always use the tab. From what I realized, in other tests I did, the Stylus is very sensitive to errors in the code. Not always where it points is where the problem is, it is worth checking the code.

Thanks for the personal help

  • Use the edit link in your question to add other information. The Post Answer button should only be used to complete answers to the question. - From Review

  • 1

    @Otto, is an answer, may be poor, poorly explained, but it is an answer; voting to delete is not appropriate. . . . . Clara, the ideal is you put the solution as suggested by Rubens Barbosa (giving due credit)

  • Sorry, guys, I’ve already edited my answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.