Giter Club home page Giter Club logo

nesting.js's People

Contributors

nathggns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nesting.js's Issues

Responds weirdly to comments

Any comments that cover a full nested block wil not work, as the block is moved out of the comment.

For example:

/* This */
body {
    /* & a {
        color: #333;
    } */
}

/* Will compile to something like */
body { /**/ }
body a { color: #333; }

/* When it should compile to */
body { /* & a { color: #333; } */ }

But, comments actually within the nested blocks work fine.

Nesting.js responds weirdly to selector lists

When a block is nested within a parent that is a selector list, or when a selector list is nested, nesting.js acts a bit weirdly.

This:

strong, b {
    font-weight: bold;
    & a { font-weight: normal; }
}

compiles to something like

strong, b {
    font-weight: bold;
}

strong, b a {
    font-weight: normal;
}

when it should compile to

strong, b {
    font-weight: bold;
}

strong a, b a {
    font-weight: normal;
}

& Operator

The CSS working group states that the & operator is required to state that nesting is about to happen. In Nesting.js, this isn't required. This should be fixed so that it follows the official syntax as close as possible.

The official syntax looks a little like

p {
    color: #222;

    & a {
        color: #444;
        &:hover { background: #fafafa; }
    }
}

Modernizr isn't being used

Modernizr is included with Nesting.js, but it isn't being used. It should either be removed, or used to test for native Nesting support, to support forward-compatibility.

All rules outside blocks break Nesting.js

Any rules outside blocks will break Nesting.js. This includes media queries, imports, font-faces, and any of those other things.

For example, this will break Nesting.js.

@media screen and (min-width: 20px) {
    body {
        background: #f00;
    }
}

Can't not use pseudo selectors or elements

Cannot use psuedo selectors or elements when nesting.

body {
    &:hover { background: #000; }
}

will turn into something like

body :hover { background: #000; }

instead of

body:hover { background: #000; }

Special blocks break Nesting.js

Any special blocks will break Nesting.js. This includes @font-face and @media blocks.

Nesting.js will choke on the following code.

@media screen and (min-width: 100px) {
    body { width: 100%; }
}
body {
    background: #000;

    & header {
        height: 50px;
    }
}

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.