-
Notifications
You must be signed in to change notification settings - Fork 11
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
Idiomatic hover states #21
Comments
I wonder if we could solve this by accepting an object as {
prop: 'text-transform',
vals: [
'uppercase',
'lowercase'
],
tail: {
'-hover': ':hover'
}
} The key is appended to the 💡 But... Now that I'm seeing it, this brings up an interesting option of a slight api change. Where {
prop: 'text-transform',
vals: [
'uppercase',
'lowercase'
],
pseudo: ':hover'
} With this, we could assume we'll want a modifier to the classname, so we could generate that from the selector. e.g: .ttu-h:hover{}
.ttl-h:hover{} And of course we'd still accept object syntax to allow custom modifier, like This is a breaking change, but tbh I've not been totally happy with the gr8-util api, so I'm open to this conversation about what the object could look like. |
oh yeah, these are both pretty clean. Wouldn't you still need I think it could also be nice to be able to do something like this: {
prop: 'text-transform',
vals: [
'uppercase',
'lowercase'
],
pseudo: [ 'hover', 'active', 'focus']
} Nit, but it seems slightly unnecessary (although maybe it reads clearer?) to include the colon on the arguments to And then the convention would be first dash comes from join, second dash comes from pseudoclass? |
✨ Yes, I think the {
prop: { fc: 'color' },
vals: {
red: '#f00',
blue: '#00f'
},
join: '-',
pseudo: 'hover'
} .fc-red-h:hover { color: #f00 }
.fc-blue-h:hover { color: #00f } Gonna try to schedule myself to make these changes to gr8-util this weekend. |
@s3ththompson opened jongacnik/gr8-util#2 in |
Adding a |
Is the the most idiomatic way to generate rules for hover states?
It seems like something like this might be a little cleaner...
The text was updated successfully, but these errors were encountered: