Giter Club home page Giter Club logo

Comments (8)

yunusga avatar yunusga commented on May 30, 2024

Hi @in-in. Can you show before after CSS?

from postcss-sort-media-queries.

in-in avatar in-in commented on May 30, 2024

I showed before CSS in the question (see the footer component above), but I do not have after CSS so the project can not build

from postcss-sort-media-queries.

yunusga avatar yunusga commented on May 30, 2024

I create two test for this case, and all works fine

√ postcss media minmax -> nested (4 ms)
√ postcss nested -> media minmax (2 ms)
// mediaMinmaxBeforeNestedRun
postcss([autoprefixer, flexbugsFixes, mediaMinMax, nested, plugin(opts)]).process(input, { from: undefined })

// mediaMinmaxAfterNestedRun
postcss([autoprefixer, flexbugsFixes, nested, mediaMinMax, plugin(opts)]).process(input, { from: undefined })

Before

.footer {
    grid-area: footer;
    background-color: green;

    @media (width >= 600px) {
        background-color: pink;
    }

    .footer-content {
        grid-area: footer-content;

        @media (width >= 990px) {
            background-color: aliceblue;
        }
    }
}

After

.footer {
    grid-area: footer;
    background-color: green;
}

.footer .footer-content {
    grid-area: footer-content;
}

@media (min-width: 600px) {
    .footer {
        background-color: pink
    }
}
@media (min-width: 990px) {
    .footer .footer-content {
        background-color: aliceblue
    }
}

from postcss-sort-media-queries.

yunusga avatar yunusga commented on May 30, 2024

@in-in This issue happen only with postcss-sort-media-queries?

from postcss-sort-media-queries.

yunusga avatar yunusga commented on May 30, 2024

@in-in Try this order for plugins in postcss.config.js

plugins: {
    'postcss-nested': {},
    'postcss-media-minmax': {},
    'autoprefixer': {},
    'postcss-flexbugs-fixes': {},
    'postcss-sort-media-queries': {}
}

from postcss-sort-media-queries.

in-in avatar in-in commented on May 30, 2024

Nope, reordering didn't work for me
If I comment out this line, my project builds fine
211071618664621

I created a test case for your investigation https://github.com/in-in/postcss-test-case

from postcss-sort-media-queries.

yunusga avatar yunusga commented on May 30, 2024

@in-in without nested with sort - ok
without sort with nested - ok

One more conflict with nested

from postcss-sort-media-queries.

yunusga avatar yunusga commented on May 30, 2024

@in-in problem solved after update to
postcss: 8.2.13
postcss-sort-media-queries: 3.9.10

from postcss-sort-media-queries.

Related Issues (10)

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.