blakeembrey / free-style

Make CSS easier and more maintainable by using JavaScript
MIT License
707 stars 29 forks source link

Document interpolation #36

Closed basarat closed 8 years ago

basarat commented 8 years ago

Closes https://github.com/blakeembrey/free-style/issues/34 :rose:

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 98.76% when pulling 7d8e109485bc3e7fcaa5957f7be0e9614d047462 on basarat:patch-1 into 67843aa75ec8f0a80d1fa483191508b9469a98f6 on blakeembrey:master.

blakeembrey commented 8 years ago

FWIW, interpolation is recursive too. It's the same way LESS works. So you can do things like:

{
  '& > &': {},
  '&:hover .child': {},
  '&:hover': { '.child': {} },
  '.parent &': {},
  '& .child': {} // This is the default behaviour when no `&` exists in the selector.
}

This is really only an extra note related to https://github.com/blakeembrey/free-style/issues/37 which I think about it 😄