整容Facelift是在Scala中为CSS创建DSL的实验。目标是可发现性类型安全性易用性

编写HTML:


val titleId = Id(\"title\")

val titleClass = Class(\"cool\")

val titleStyle = Style(Color.Green, Margin(45 px, 20 px, 10 px), 'paddingLeft -> \"10px\")

val html1 = Html {

  Body(Style('backgroundColor -> \"#F5F5F5\")) {

    // Most bootstrap classes are built in, let's bind them to Bs

    import com.github.tbje.facelift.c