scss-@if指令


  @if指令接受表达式和使用嵌套样式,无论表达式的结果只不过是false或null。

  语法:

@if expression {  //CSS codes are written here }

  scss实例:

p{
    @if 10 + 10 == 20   { border: 1px dotted;   }
    @if 7 < 2     { border: 2px solid;  }
    @if null    { border: 3px double; }
}

  编译后的代码如下:

p {
  border: 1px dotted; 
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM