-
Notifications
You must be signed in to change notification settings - Fork 4
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
Unable to get postcss plugins working #34
Comments
I've tried different postcss strategies (as config file or config object) -- No change |
Hi @janniks It's a bit of deep PR you've linked there and difficult to know what the end result you're expecting here. I'll try pull your branch this evening and give it a try. Could you detail exactly what you are expecting to happen? (like "I have class someclass, I expect this to be renamed to moz-someclass") Off the top of my head, what you could try is move the configuration out of the default options and use the |
Hi @janniks I couldn't get your repo to run properly, some sort of missing deps. But I did manage to get lerna to build the component. From what I can tell, it is working as expected. The simplest way of testing this is to set the configuration to remove setPluginConfigurationDefaults({
...PluginOpts.DEFAULT,
enableDebug: true,
stripComments: true,
useAutoPrefixer: false, // <-- important, disable the internal autoprefixer
tailwindConf,
postcss: {
plugins: [
tailwindcss(),
// autoprefixer(), // <-- no autoprefixer here
]
}
}); Add the following class to the component and the css: .example {
display: grid;
transition: all .5s;
user-select: none;
background: linear-gradient(to bottom, white, black);
} Then build the site - stash the result. Add setPluginConfigurationDefaults({
...PluginOpts.DEFAULT,
enableDebug: true,
stripComments: true,
useAutoPrefixer: false, // <--- important, still make the internal autoprefixer disabled
tailwindConf,
postcss: {
plugins: [
tailwindcss(),
autoprefixer(),
]
}
}); Build the site again, and compare the outputs. The In my setup, without .example {
background: linear-gradient(180deg, #fff, #000);
display: grid;
transition: all .5s;
user-select: none
} (as expected, no prefixing) - with .example {
background: linear-gradient(180deg, #fff, #000);
display: grid;
transition: all .5s;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none
} (as epected, prefixed I would conclude that the postcss configuration is working as expected. If you could give more details on what you are expecting to happen. If you are expecting that As example: const modalCss = " ... some log css string ...";
const Modal = class {} // Actual component class for the web component
Modal.style = modalCss; // <-- this style is used to component style block as memory serves Hence, the |
Thanks so much for investigating. 🙏🏻 I was mainly looking at the content of the modalCss string. I'll try again. I'll set up a codesandbox to reproduce, if possible. |
I'm trying to get postcss working, but it seems the examples and docs aren't working for me.
Project to reproduce here: hirosystems/connect#346
This builds the stencil component in the monorepo. Inspecting the file at
packages/connect-ui/dist/cjs/connect-modal.cjs.entry.js
shows themodalCss
is NOT renamed. Anything I'm missing?Thanks for the project, thanks for the help 🙏
The text was updated successfully, but these errors were encountered: