com.github.woojiahao.style.css.CssProperty.kt Maven / Gradle / Ivy
package com.github.woojiahao.style.css
import com.github.woojiahao.style.Settings
import com.github.woojiahao.style.Settings.Theme.DARK
import com.github.woojiahao.style.Settings.Theme.LIGHT
class CssProperty(
var theme: Settings.Theme,
private var light: T? = null,
private var dark: T? = light,
private var fallback: T? = null
) {
var value: T?
get() = when (theme) {
LIGHT -> light
DARK -> dark
} ?: fallback
set(input) {
light = input
dark = input
}
}