2016-12-10 31 views

回答

1

doesn't look like ScalaTags provides it

我們可以寫自己的,雖然我們的:

object Foo extends StyleSheet { 

    implicit class CreatorWrapper(val creator: Creator) extends AnyVal { 
    def nthChildEven: Creator = nthChild("even") 
    def nthChild(arg: String): Creator = creator.pseudoExtend(s"nth-child($arg)") 
    } 

    val foo = cls.nthChildEven(
    backgroundColor := "red" 
) 
} 

或者,如果你不想讓隱類:

object Foo extends StyleSheet { 
    val foo = cls.pseudoExtend(s"nth-child(even)")(
    backgroundColor := "red" 
) 
} 
相關問題