-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Reproducing an email exchange with @necolas, after sending him http://glenmaddern.com/articles/introducing-am-css, because I think this is a nice use of attribute selectors with class-based components
Looks cool. I've played around with something similar:
<tag class="Component is-state" ui-prop="value"> <tag class="Component-private">For example:
<tag class="Nav is-open" ui-size="large" ui-color="blue"> <tag class="Nav-item is-selected" ui-name="Home">Because it works with a component API quite easily. Also have it working with classes (just needs a helper to act as a class map, like in React), so not yet decided on which one we'll use.
Good luck
Interested why you didn't go with something like ui-state="selected" instead of class="is-selected" though?
Because ui-* was reserved for the component API, and state isn't a direct configuration option. The "private" sub tree of the component probably shouldn't have any ui-* attributes within it.
Here's a demo of the context for that (I was trying to hack flightjs to work as a ui component framework, but gave up on it): http://codepen.io/necolas/pen/Djbpr