0

Is it possible in Less CSS to get the parent of the parent?

I'm wondering if it's possible to do something like this:

#parent1 {
  #parent2 {
    #grandparent & & {
      /* stuff */
    }
  }
}

to equate to:

#grandparent #parent1 #parent2 { /* stuff */ }

Thoughts?

4

1 回答 1

2

I pasted your code here: http://less2css.org/

Instead of:

#parent1 {
  #parent2 {
    #grandparent & & {
      /* stuff */
    }
  }
}

I tried

#parent1 {
  #parent2 {
    #grandparent & {
      /* stuff */
    }
  }
}

And that equates to: #grandparent #parent1 #parent2 { /* stuff */ }

Is this what you're asking for?

于 2013-07-09T15:19:26.590 回答