开发者

Stylus ParseError: expected "indent", got "outdent"

开发者 https://www.devze.com 2023-03-18 19:47 出处:网络
Stylus ParseError: expected \"indent\", got \"outdent\" Unable to compile Stylus file app/css/app.styl to CSS: ParseError: app/css/provider.styl:22

Stylus ParseError: expected "indent", got "outdent"

Unable to compile Stylus file app/css/app.styl to CSS: ParseError: app/css/provider.styl:22
   18|  padding-top开发者_开发问答: 20px
   19|  text-align: center
   20|  border-bottom: 1px solid white
   21|  margin-bottom: 25px
 > 22| 
   23| .aclass
   24|  display: none
   25| 

expected "indent", got "outdent"

What am I doing wrong here? Thanks for any information on this error!


I tend to get this when converting CSS files from other libraries. Usually, it has to do with a nearby rule that contains a filter property.

When a rule contains any Microsoft "progid" you need to escape the entire value.

filter: unqoute("progid:DXImageTransform.Microsoft.gradient(startColorstr='#2b80ff', endColorstr='#1d66d3', GradientType=0)")
-ms-filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=50)")

And finally, Stylus has a build-in alpha function so you need to escape it with unquote it like so:

filter: unquote("alpha(opacity=50)")


found some hidden white space

:/ watch out!


Got same error message when I forgot to quote a path.

error:

.bg-img-001
   background-image imgs/img-001.jpg

no error:

.bg-img-001
   background-image 'imgs/img-001.jpg'


I've had this issue when i've mixed using spaces for indentation and tabs for indentation.

A good way to see if you're doing that is to select the text using Sublime 2-- tabs are bars and spaces are dots in selected text.

In the end i converted the spaces to tabs.


I got this error because I had a class that started with a number.

.1080spacer
  z-index 1

etc. The error appeared on the next class declaration line. Once I moved the number to the end of the class, the error went away. Like this:

.spacer1080
  z-index 1

That solved it for me.


Mine was 8 lines up where I had .e7e7e7 instead of #e7e7e7.

0

精彩评论

暂无评论...
验证码 换一张
取 消