Allow definition of global styles with objects and helpers
Closed this issue · 4 comments
vdanchenkov commented
Currently we can do
insertRule('html, body { padding: 0 }')
It would be great to support same definition as in createElement helper. Something like:
global('html, body', { padding: 0 })
global('a', [ { color: 'red'}, hover({ color: 'blue' }) ])
threepointone commented
Good idea, I like it! Have to call it something other than global
, but I'm for it. I'll have to get to this after a week or so, unless I see a PR :)
threepointone commented
How about this
insertGlobal('html, body', { padding: 0 })
insertGlobal('a', { color: 'red' })
insertGlobal('a:hover', { color: 'blue' })
threepointone commented
import { insertGlobal } from 'glamor'
is available in 2.17.2, give it a spin and let me know how it feels.
threepointone commented
closing this for now. v3 will merge insertRule and insertGlobal (I think)