Home > Net >  css linter expecting RBRACE around rotate function
css linter expecting RBRACE around rotate function

Time:10-19

Running the following chunk of CSS through this linter

.spin-out.mui-leave.mui-leave-active {
  -webkit-transform: rotate(0.75turn);
      -ms-transform: rotate(0.75turn);
          transform: rotate(0.75turn);
  opacity: 0; }

and it is returning

Expected RBRACE at line 2, col 29.

  -webkit-transform: rotate(0.75turn);

this error crops up for every invocation of rotate of a much longer file. The semi-colons appear appropriate and I do not believe the rotate function required curly brackets.

What could be going on here?

CodePudding user response:

The linter fail because csslint does not know the unit turn. You can make it pass with deg:

.spin-out.mui-leave.mui-leave-active {
      -webkit-transform: rotate(270deg);
          -ms-transform: rotate(270deg);
              transform: rotate(270deg);
      opacity: 0;
}

Note that like deg, grad and rad, turn should be valid and well supported. I guess csslint is a bit old or buggy.

I found on GitHub an issue about turn and csslint from 2018. The last release on GitHub was in 2016.

Time to switch to Prettier maybe?

  •  Tags:  
  • css
  • Related