Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested @supports doesn't seem to work #1691

Closed
jcayzac opened this issue Nov 29, 2013 · 8 comments
Closed

Nested @supports doesn't seem to work #1691

jcayzac opened this issue Nov 29, 2013 · 8 comments

Comments

@jcayzac
Copy link

jcayzac commented Nov 29, 2013

Less:

.foo() {
    font-weight: 300;
    -webkit-font-smoothing: subpixel-antialiased;
    @supports not (-webkit-font-smoothing: subpixel-antialiased) {
        font-weight: 400;
    }
}

html {
    .foo;
}

Generated CSS:

html {
  font-weight: 300;
  -webkit-font-smoothing: subpixel-antialiased;
}
@supports not (-webkit-font-smoothing: subpixel-antialiased) {
  font-weight: 400;
}

Expected CSS:

html {
  font-weight: 300;
  -webkit-font-smoothing: subpixel-antialiased;
}
@supports not (-webkit-font-smoothing: subpixel-antialiased) {
  html {
    font-weight: 400;
  }
}
@lukeapage
Copy link
Member

e.g. you are expecting it to work like media bubbling. this would make sense.

@jcayzac
Copy link
Author

jcayzac commented Dec 4, 2013

@lukeapage yes I assumed it was treated the same way (but I was wrong, obviously)

@matthew-dean
Copy link
Member

I wouldn't expect us to support @supports until it hits widespread usage (unless it's trivial to make it similar to @media queries). It's currently only in Firefox / Chrome desktop.

@Soviut
Copy link

Soviut commented Dec 27, 2013

@matthew-dean that means it's only a few months away from mobile acceptance, so let's get it sorted by then.

@matthew-dean
Copy link
Member

It's not yet in Mobile Safari. The first it could appear would be iOS8. I agree we should have it, but I think that gives us at least 6 months. :-)

@SomMeri
Copy link
Member

SomMeri commented Sep 17, 2014

Related to #2104

@nilssolanki
Copy link

nilssolanki commented Feb 6, 2018

Workaround for people stuck on older versions of less:

Use the @supports directive outside of all your code. E.g.:

@supports not (-webkit-font-smoothing: subpixel-antialiased) {
  html {
    font-weight: 400;
  }
}

@schizek
Copy link

schizek commented Sep 26, 2023

Are nested @supports supported in LESS yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants