HeapsIO / domkit

CSS Components based strictly typed UI framework for Haxe
MIT License
84 stars 20 forks source link

Support @:p on enums with parameters #59

Closed Speedphoenix closed 4 months ago

Speedphoenix commented 4 months ago

This PR adds support for cases like these:


enum Color {
    Blue;
    LightBlue;
}

enum ModeEnum {
    Linear;
    Polynomial(pow: Float, ?offset: Float);
    Colored(c: Color);
    Combined(a: ModeEnum, b: ModeEnum, v: Float);
}

class MyComp {
    @:p var mode: ModeEnum;
}

In this case, in the css these are acceptable:

mode: linear;
mode: polynomial(2.5);
mode: polynomial(2.5, 5);
mode: colored(light-blue);
mode: combined(linear, colored(blue));