postcss-pxtorem icon indicating copy to clipboard operation
postcss-pxtorem copied to clipboard

Media queries

Open mars-abd opened this issue 10 years ago • 1 comments

I develop version for smartphones for some project and use this plugin. All styles compiles from pixels to rems, only base css rules are left in px, like this:

html { // for desktop
    font-size: 14px;
}
@media (max-width: 500px) { // for phones
    html {
        font-size: 11px;
    }
}

Generally it is good, fast and simple solution to make mobile version. But for some ui blocks I use media queries overrides for small screen. And I want to keep this values in pixels. It will be good to have ability to ignore css rules in media queries (not there – @media (max-width: 500px) )

mars-abd avatar Jul 17 '15 12:07 mars-abd

This happened to me, too. .postcssrc.js下

module.exports = { "plugins": { 'postcss-pxtorem': { rootValue: 32, propList: ['*'], mediaQuery: false }, "postcss-import": {}, "postcss-url": {}, // to edit target browsers: use "browserslist" field in package.json "autoprefixer": {} } }

BARMPlus avatar Jan 10 '19 11:01 BARMPlus