tuix icon indicating copy to clipboard operation
tuix copied to clipboard

Custom style sheet properties for custom widgets

Open WeirdConstructor opened this issue 4 years ago • 0 comments

It would be awesome to have custom style properties in style sheets for custom widgets. I often have the problem that I would love custom colors and line thickness for my custom widget drawing. I would suggest collecting style properties that start with ext- or -ext- (what ever you like) and provide widgets a way to access them:

block_code {
    -ext-block-border-width: 10px;
    -ext-block-color1: #FF00FF;
    -ext-block-color2: #FFFFFF;
    -ext-block-color3: #FF0000;
}

The type of the HashMap could be HashMap<String, StyleValueEnum> and the StyleValueEnum (if tuix doesn't already have something like this) could then be used by the widget to check if the contents is a color or size (or whatever types are possible).

WeirdConstructor avatar Nov 08 '21 11:11 WeirdConstructor