less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17k stars 3.41k forks source link

.flubber & {} does not work in client side version of less.js (IE7 only) #614

Closed snorripall closed 11 years ago

snorripall commented 12 years ago

Oh the irony. This works in all browsers except IE7 when you're using the client-side version of less.js.

#foobar{
    display:inline-block;
        .flubber & {
            zoom:1;
            display:inline;
            }
}

Should output to


#foobar{
     display:inline-block;
}

.flubber #foobar {
   zoom:1;
   display:inline;
}

So a fix for IE7 would be greatly appreciated.

Punk-UnDeaD commented 12 years ago

bubble selector more powerfull feature, you can use Modernizr.js, cssua.js etc please vote for my patch

https://github.com/cloudhead/less.js/issues/435

maranomynet commented 12 years ago

@Punk-UnDeaD, you see, this:

.foo {
    .bar  {
        html.ua-ie-7 & {
            color: red;
        }
    }
}

does indeed compile to:

html.ua-ie-7 .foo .bar {
    color: red;
}

...both with lessc on the server, and with less.js in all browsers. All except MSIE7.

There's a IE7 specific javascript bug that needs to be fixed.

Once it's fixed the special-casing proposed in issue #435 becomes redundant.

Punk-UnDeaD commented 12 years ago

@maranomynet I do not use "&" for reorganize selector I use bubble selector from my patch, because it is more powerfull and understandable

lukeapage commented 12 years ago

Hi,

I don't have IE7 but I've just re-written the way parent selectors work to be more powerfull.. any chance you can retest?

lukeapage commented 11 years ago

dead bug