Closed toth-istvan-zoltan closed 1 month ago
Modifying the appearance of elements is done different ways on different platforms:
The instruction concept is an abstraction inspired by Tailwind and Compose modifiers.
fun main() { browser { hello(padding_10, border_1, border_color_black, /* the other parameters */) } } @Adaptive fun hello(vararg instructions : AdaptiveInstruction, /* other parameters */) { /* whatever hello does */ }
The actual implementation of the instruction should be adapter dependent:
val padding_10 = AdaptiveInstruction("padding_10")
object CssInstructionFactory : Registry<AdaptiveInstruction> { init { + CssAdaptiveInstruction(padding_10, "padding: 10px")) } }
AndroidAdaptiveInstruction({ it.setPadding(10) }) object AndroidInstructionFactory : Registry<AdaptiveInstruction> { init { + AndroidAdaptiveInstruction(padding_10) { it.setPadding(10) } } }
Cons:
Pros:
Implemented the basic concept.
Modifying the appearance of elements is done different ways on different platforms:
The instruction concept is an abstraction inspired by Tailwind and Compose modifiers.
The actual implementation of the instruction should be adapter dependent:
Cons:
Pros: