Less CSS parsing errors: file definitions require block instructions

I use codekit to compile my Bootstrap LESS files, and I keep getting this parsing error in media queries that I didn't get when it was previously a CSS file.

"ParseError: file definitions require block instructions after any function in /assets/less/homepage.less on line 568, column 2: 567 @media (max-width: @iphone_breakpoint) {568}"

The following is a complete line of code:

/* Custom, iPhone Retina */ @media (max-width: @iphone_breakpoint) { } 

Can anyone explain what is happening?

+5
source share
1 answer

Just this error, found that the problem was a simple syntax error. I will write what worked for me.

The error is :

 >> SyntaxError: media definitions require block statements after any >> features in _assets/less/styles.less on line 144, column 2: >> >> 143 >> 144 div { >> 145 .links { 

Please note that the error indicates that the line is around 144-145 , below we will see

In the code below, I forgot . (period) when using the built-in .hidden() mixin .

Gives an error message:

SyntaxError: definitions in files require block instructions after any functions in the dir / bar / foo.less directory on line 144, column 2:

A bit misleading as the error is a child of this div on line 149 .

 div { // Line 144 .links { .hidden(); } .other-links { // Missing `.` for using the mixin hidden(); // The real error is here on Line 149 } } 

Summary:

Make sure that you have no syntax errors in the child elements where the displayed error noticed an error.

  • Check intermediate periods before mixins. hidden() -> .hidden()
  • Check all other errors ?

Found another syntax error causing this error?
let us know the comment below

+6
source

Source: https://habr.com/ru/post/1239609/


All Articles