hoplon / ui

experimental ui component library for the browser
31 stars 6 forks source link

developer wants to the value of an attribute to change based on the state of a parent. #5

Open jumblerg opened 8 years ago

jumblerg commented 8 years ago

in addition to being paired with a vector of values delimited by screen widths to support responsive layouts, attributes should also be able to accept a mapping of values that will change based on the predefined states of a component.

(hoplon.ui/button :w 200 :h 60 :color {:up 0xFFF :over 0xEEE :down :0xCCC :disabled 0x666} "Click Me")

this may not be an ideal long-term solution: overloading vectors and maps for this purpose, while syntactically convenient, is arguably semantically abusive. it may be worth considering custom types instead.

jumblerg commented 7 years ago

this is partially achieved by the state s function. this does not seem like the correct approach, however.