Giter VIP home page Giter VIP logo

Comments (6)

MoOx avatar MoOx commented on May 30, 2024 2

What about transforming this to that

html, body { height: 100%; }

@media screen {
  html {
    background: yellow;  
  }
}
@media screen and (max-width: 1100px) {
  html, body {
    background: green
  }
}  
@media screen {
  body {
    background: red;
  }
}

from postcss-cssnext.

lyzadanger avatar lyzadanger commented on May 30, 2024

You can also nest @supports per the conditional module that covers nesting @media (any combination can be nested): http://dev.w3.org/csswg/css-conditional-3/

http://jsbin.com/xoqeso/2/edit

from postcss-cssnext.

idoo avatar idoo commented on May 30, 2024

yes, i think it's really cool feature

from postcss-cssnext.

Semigradsky avatar Semigradsky commented on May 30, 2024

Silly example (https://jsbin.com/sakuxiz/edit?css,output):

@media screen {
  html {
    background: yellow;  
  }

  @media (max-width: 1100px) {
    html, body {
      background: green
    }
  }  

  body {
    background: red;
  }
}

We can't move media without ruining styles.

from postcss-cssnext.

jonathantneal avatar jonathantneal commented on May 30, 2024

That markup will work fine in postcss-nesting.

from postcss-cssnext.

MoOx avatar MoOx commented on May 30, 2024

postcss-cssnext has been deprecated in favor or postcss-preset-env. Read more at https://moox.io/blog/deprecating-cssnext/

from postcss-cssnext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.