whoisvadym / eleventy-plugin-postcss

Eleventy plugin for PostCSS library
11 stars 2 forks source link

Using 11ty and postcss custom media #13

Open verdickta opened 6 months ago

verdickta commented 6 months ago

Im trying to use postcss custom media with 11ty and found this. I followed along but I seem to have an issue.

I did the npm install, I added a postcssrc and updated my eleventy.js. Both files are located in the root of the project.

My .postcssrc.json file looks like followed: { "plugins": { "postcss-custom-media": {} } }

and in my .eleventy.js I included this `const PostCSSPlugin = require("eleventy-plugin-postcss");

module.exports = function (eleventyConfig) { ... eleventyConfig.addPlugin(PostCSSPlugin); return {...}; }; `

Im using @imports in my style.css file where I have a settings.mq with the custom media like this: @custom-media --desktop (min-width: 61.25em);

If I try to use this in an other css file, it is not doing anything.

In my compiled public folder the --desktop is also not changing to the min-width: 61.25em.

Im not seeing any console log or terminal errors and I can build without any issues.

Am I overseeing something?