Skip to content

Feedback #6

@geelen

Description

@geelen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions