Search code examples
shopwareshopware6

(Hot Proxy) watch-storefront compile pixel units to rem


I am using the watch-storefront.
The problem is that the pixel units compile to rem.

enter image description here

Someone an idea to prevent it for watch-storefront?

Version: 6.4.20


Solution

  • Looks like this was recently changed.

    The postcss.config.js looks like this:

    module.exports = {
        plugins: {
            'autoprefixer': {},
            'postcss-pxtorem': {
                propList: ['*']
            }
        }
    };
    

    So it uses a plugin for px to rem conversion, but only during hot proxy mode.

    If you have to stick with a version of Shopware prior 6.5, then find the config at src/Storefront/Resources/app/storefront/postcss.config.js or vendor/shopware/storefront/Resources/app/storefront/postcss.config.js, depending on the template you're using, and simply remove the postcss-pxtorem plugin:

    module.exports = {
        plugins: {
            'autoprefixer': {}
        }
    };