-
Notifications
You must be signed in to change notification settings - Fork 9
Unitless non print media queries always first #7
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
Conversation
Hi @vis97c . Thanks for PR. |
Just fixed the validation and updated the mixed tests accordingly. E: I think this is the best behavior but some people dependant on this project could think different, so do you think this new approach should be behind a flag or parameter? |
I believe that this behaviour should be controlled by developer themselves. But we cannot just add parameter or flag to the sort because our methods used as references and we need to create some redundant closure for currying to do that work. Second, the package is being used as part of other modules, and they will have to change their workflow to handle our changes. This process can take a long time and not every module will be ready to go for it. Give me a day or two to think about how best to implement such an opportunity in order to solve your current problem and make it possible to develop the configuration in the future. |
Ok, sounds good for me. Let me know if there anything more i can do to make things easier. |
Hi @vis97c! In this case - we can control process as we want. So now - your PR is failed with conflicts (( Can you update your PR with this new structure? If you will take it - I left some checkpoints for your in codebase and for tests |
We will update the npm package after the implementation of the working param |
Just updated the mr to comply with the new structure as well as the tests and some new details to the readme. ¿Can you please take care of the russian translation? i know nothing of that language appart from "priviet". The change in the readme is because i added the possibility to pass the parameter when importing the package as another alternative, this because it fits my needs the most. // now available
const sortCSSmq = require("sort-css-media-queries")({
unitlessMqAlwaysFirst: true,
});
module.exports = {
// postcss config
map: false,
plugins: [
require("node-css-mqpacker")({
sort: sortCSSmq.desktopFirst,
}),
],
env: "production",
preset: { stage: false },
}; Let me know is there is any issue, i will take care of anything else on the weekend |
Hi! Thanks for making changes. About translations - no problem! I will take it for myself. But changes in index.js - not suitable, because the main use case for the package is to use the sorting method directly by reference, without "creating" it. Please revert it To fit your needs - you can just import - const sortCSSmq = require("sort-css-media-queries")({
+ const sortCSSmq = require("sort-css-media-queries/lib/create-sort")({
unitlessMqAlwaysFirst: true,
}); |
But isn't it the same? If you really want it that way is ok then. This would still work in the same way. Without adding further parameters or breaking previous functionality. const sortCSSmq = require("sort-css-media-queries") |
I was encapsulating my default styles in this media querie to prevent the styles from affecting print styles:
But because of the sorting method it was always on the middle, overriding other media queries.
This is the current behavior:
And this is the expected one: