Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to configure interactive states for components #6

Open
SirPepe opened this issue Jun 17, 2019 · 1 comment
Open

Add option to configure interactive states for components #6

SirPepe opened this issue Jun 17, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@SirPepe
Copy link
Member

SirPepe commented Jun 17, 2019

Simple component without states:

{
  "name": "Navigation",
  "source": ".navigation"
},

Simple component with an additional state (state is just a simple selector):

{
  "name": "Navigation",
  "source": ".navigation",
  "states": [ ".navigation.open "]
},

Not so simple component with an additional state (state is a mapping for target and source, one object for each state):

{
  "name": "Navigation",
  "source": ".navigation",
  "target": "nav",
  "states": [{
    "source": ".navigation.open",
    "target": "nav.activated"
  }]
},

Before this gets added it should be demonstrated that a simple selector like nav.activated can be turned into a function that can set the element into the state described by the selector

@SirPepe SirPepe added the enhancement New feature or request label Jun 17, 2019
@SirPepe SirPepe self-assigned this Jun 17, 2019
@drublic
Copy link
Member

drublic commented Jul 19, 2019

Is the state meant to be triggered on a component? So do classes get applied to the component?
It think this should not be the case.

The state is thus just a description of a specific variant of the component. So it could be more like a variants array which could contain more than just states. For example you could describe different variants of a single component "button".
These variants might be treated as separate components though.
Sounds more like syntactic sugar for the config than a backend implementation, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants