Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Add support for traits #14

Open
pjechris opened this issue Jan 3, 2017 · 3 comments
Open

Add support for traits #14

pjechris opened this issue Jan 3, 2017 · 3 comments

Comments

@pjechris
Copy link
Owner

pjechris commented Jan 3, 2017

Would be nice to be able to adapt style based on current trait. Just like @media in CSS.

@ghost
Copy link

ghost commented Jan 3, 2017

Do you have an example of declaration you would like to have?

@pjechris
Copy link
Owner Author

pjechris commented Jan 3, 2017

Not really sure how we should do it, maybe by combining it with states?

let blueBtn = Style() {
	$0.extends(otherStyle)

	$0.when(state: .hover) {
		$0.extends()
	}

	let trait = TraitCollection()
	$0.when(trait: trait) {
	}

	$0.when(state: .hover, trait: trait) {
	}
}

This would have impact on states. IMO this is not a big deal as current syntax is not great.
Any comment is appreciated ;)

@pjechris
Copy link
Owner Author

pjechris commented Jan 5, 2017

We could in fact handle traits this way and refactor states afterwards.

@pjechris pjechris added this to the 1.0 milestone Jan 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant