css-dsl :用于CSS框架的DSL
而不是像这样的字符串式,嘈杂的代码,
< .div(
^.cls : = ( " panel hidden-xs panel- " + ( if (success) " success " else " default " )),
< .div(
^.cls : = " panel-heading " ,
< .h3(^.cls : = " panel-title " , " Panel title " )
)
)
编写这样的代码:
< .div.panel.hiddenXs(
if (success) C .panelSuccess else C .panelDefault,
< .div.panelHeading(
< .h3.panelTitle( " Panel title " )
1