More properties

This commit is contained in:
2020-03-15 19:36:18 +01:00
parent 5a0eeac2fe
commit 5b557c8535
3 changed files with 38 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package nl.astraeus.css.style
import nl.astraeus.css.properties.*
import nl.astraeus.logging.log
import kotlin.time.Duration
typealias Css = Style.() -> Unit
@@ -364,6 +365,34 @@ open class Style(
fun all(all: All) { properties["all"] = toProp(all) }
fun alignSelf(alignSelf: AlignSelf) { properties["align-self"] = toProp(alignSelf) }
fun animation(text: String) { properties["animation"] = listOf(CssProperty(text)) }
fun animationDelay(delay: DelayDuration) { properties["animation-delay"] = listOf(delay) }
fun animationDirection(direction: AnimationDirection) { properties["animation-direction"] = listOf(direction) }
fun animationDuration(duration: DelayDuration) { properties["animation-duration"] = listOf(duration) }
fun animationFillMode(fillMode: AnimationFillMode) { properties["animation-fill-mode"] = listOf(fillMode) }
fun animationIterationMode(vararg iterationMode: Count) { properties["animation-iteration-mode"] = iterationMode.toList() }
fun animationFrame(frame: AnimationFrame) { properties["animation-frame"] = listOf(frame) }
fun animationName(vararg name: String) { properties["animation-name"] = name.toList().map { an -> CssProperty(an) } }
fun animationPlayState(vararg state : AnimationPlayState) {
properties["animation-play-state"] = state.toList()
}
fun animationTimingFunction(vararg timingFunction: AnimationTimingFunction) {
properties["animation-timing-function"] = timingFunction.toList()
}
/*
"animation-delay" to animationDelay,
"animation-direction" to animationDirection,
"animation-duration" to animationDuration,
"animation-fill-mode" to animationFillMode,
"animation-iteration-count" to animationIterationCount,
"animation-frame" to animationFrame,
"animation-name" to animationName,
"animation-play-state" to animationPlayState,
"animation-timing-function" to animationTimingFunction,
*/
fun color(color: Color) { properties["color"] = listOf(color) }
fun backgroundColor(color: Color) { properties["background-color"] = listOf(color) }
fun borderRadius(radius: Measurement) { properties["border-radius"] = listOf(radius) }
fun borderRadius(