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

pseudo classes #18

Closed
tbrannam opened this issue Nov 13, 2014 · 3 comments
Closed

pseudo classes #18

tbrannam opened this issue Nov 13, 2014 · 3 comments

Comments

@tbrannam
Copy link
Contributor

I'd propose supporting pseudo classes that allow styling on device form factor.
as a minimum "phone". "tablet" -

I could see perhaps following the pattern of size-classes instead (width-compact, width-any, width-regular, height-compact, height-any, height-regular)?

It might also be helpful if the Pseudo Class Parse supported multiple Pseudo Classes in a style definition - or is there another way to express this already?

.simple:phone:landscape{
    backgroundColor: red;
}

.simple:phone:portrait{
    backgroundColor: blue;
}

.simple:tablet:portrait{
    backgroundColor: pink;
}
.simple:tablet:landscape{
    backgroundColor: green;
}
@tolo
Copy link
Owner

tolo commented Nov 14, 2014

Yes, using pseudo classes for size classes, or actually trait collections, is an idea I'm toying around with.

I haven't decided if I'm gonna go with chained or parameterized pseudo classes yet, although I'm leaning towards the latter. That would look something like this:

.simple:traits(anyWidth, regularHeight) {
    backgroundColor: red;
}

But I'm not ruling out the inclusion of a simpler device idiom pseudo class (with the possibility of chaining with interface orientation pseudo class) on top of this. I'm going to experiment a bit more and see what I come up with.

@tolo tolo closed this as completed in 96043c2 Jan 10, 2015
@tbrannam
Copy link
Contributor Author

tbrannam commented Feb 3, 2015

Adding multiple Pseudoclass support came just in time. Thanks!

@tolo
Copy link
Owner

tolo commented Feb 13, 2015

Glad to hear it! :)

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

No branches or pull requests

2 participants