postcss-dark-theme-class icon indicating copy to clipboard operation
postcss-dark-theme-class copied to clipboard

Many duplicate selectors

Open Faisal-Manzer opened this issue 5 years ago • 5 comments

I don't know what's happening but it seems like there is duplicate selector being made. I guess to check for the pre-processed style is not there.

Screenshot 2020-02-01 at 1 43 08 AM

Faisal-Manzer avatar Jan 31 '20 20:01 Faisal-Manzer

How do you use this plugin and what tool you use to compile CSS?

ai avatar Feb 01 '20 01:02 ai

I am using it with preact-cli. Also, I am using node-sass.

# postcss.config.js

module.exports = {
    plugins: [
        require('postcss-viewport-height-correction'),
        require('postcss-normalize')({ forceImport: 'normalize.css' }),
        require('autoprefixer'),
        require('postcss-combine-media-query'),
        require('postcss-dark-theme-class')({ darkClass: 'dt', lightClass: 'lt' }),
        require('postcss-combine-duplicated-selectors')
    ]
};

Faisal-Manzer avatar Feb 01 '20 01:02 Faisal-Manzer

Do you call postcss-cli on already compiled CSS from previous step or you have separated src/ and dist/ folders?

ai avatar Feb 01 '20 01:02 ai

Yeah, the Webpack config first converts sass to CSS then it processed by PostCSS. preact-cli is just like create-react-app so I don't know all those internal workings.

Faisal-Manzer avatar Feb 04 '20 20:02 Faisal-Manzer

  1. What is the input CSS?
  2. Can you disable postcss-combine-duplicated-selectors?

ai avatar Feb 04 '20 21:02 ai