Reversed Combinators in Slick

  • Avinash
  • 1
  • Oct 24, 2010
  • Web Development

In previous post I have explained introduced slick to you. You can find this post here.

In this post I will explain the Reversed combination using slick. Reversed combination is the one of the major advantage of the Slick.

Reversed Combinators are a classification of combinators that are the reverse of their original. They redirect the flow of selectors and combinators to travel up the node tree rather than down. Slick implements these by prepending ! to a selector or combinator.

This is the new way of selecting elements.

Here are some examples for that:

Matches a .chapter that is a direct parent of a paragraph

p !> .chapter
p !> .chapter

Matches all the divs that are parents of paragraphs

p ! div
p ! div

Matches all paragraphs that are direct previous siblings of another paragraph

p !+ p
p !+ p

Matches all paragraphs that are previous siblings of another paragraph

p !~ p
p !~ p

Wanting for you responses on this.

Related Posts

Written by Avinash

Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.

View all posts by: