Comments (8)
Hi @in-in. Can you show before after CSS?
from postcss-sort-media-queries.
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.
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.
@in-in This issue happen only with postcss-sort-media-queries
?
from postcss-sort-media-queries.
@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.
Nope, reordering didn't work for me
If I comment out this line, my project builds fine
I created a test case for your investigation https://github.com/in-in/postcss-test-case
from postcss-sort-media-queries.
@in-in without nested with sort - ok
without sort with nested - ok
One more conflict with nested
from postcss-sort-media-queries.
@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)
- Sort parameter issue HOT 4
- Compatibility with PostCSS 8 HOT 6
- Combine from different files? HOT 1
- not able to sort fonts correctly HOT 4
- Unexpected result (with postcss-nested 5.0.2+) HOT 3
- Recognize media types in query
- Problem with Nested media queries HOT 6
- Update dependency "sort-css-media-queries" HOT 1
- Support range notation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-sort-media-queries.