A few more questions about the new csstype RuleBuilder syntax
1. How do I combine Selectors? Is there any Way to combine two
RuleBuilder
instances?
With the old syntax I had these extensions
operator fun TagSelector.plus(other: TagSelector): TagSelector = TagSelector("$tagName, ${other.tagName}")
operator fun TagSelector.plus(other: String): TagSelector = TagSelector("$tagName, ${other}")
2. How do I generally specify complex css values?
Many expect types that are interfaces and there is no apparent constructor for them.
gridTemplateColumns = GridTemplateColumns(160.px, 1.fr)
gridTemplateRows = GridTemplateRows(72.px, 64.px, 1.fr)
gridColumn = "1 / 2" //GridColumn("1 / 2")
gridRow = GridRow("2 / span 2")
background = "linear-gradient(20deg, ${MyColors.GreenDark}, ${MyColors.Green2})"
Also I keep finding missing values like
overflowY = Overflow.auto
outline = Outline.none
textDecoration = TextDecoration.none
which used to work and now dow not exist
3. How Do I declare a fontFamily which includes custom fonts?
How do I do fontFace declarations?
I used to have this working
for ((fw, fwName) in listOf(
"100" to "Thin",
"300" to "Light",
"normal" to "Regular",
"500" to "Medium",
"600" to "SemiBold",
"bold" to "Bold",
"900" to "Black"
)) {
fontFace {
fontFamily = Goldplay.quoted.toString()
fontWeight = FontWeight(fw)
val srcValue = listOf(
"Goldplay-$fwName.woff2" to FontFormat.woff2,
"Goldplay-$fwName.woff" to FontFormat.woff
)
.map { (src, format) ->
"url('$src') format('$format')"
}.joinToString(",")
put("src", srcValue)
this.fontStyle = FontStyle.normal
}
}
4. How do I do keyframes declarations for animations?