-
Notifications
You must be signed in to change notification settings - Fork 12
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
Back slashes added? #11
Comments
There seems to be some issue with colons as well. When I don't add them after the "mixins" declared under |
Hi, are you sure the Or most probably it's because the slash is added to the declaration before the plugin runs, which breaks its "detection", so nothing happens. I would advise to always add colons at the end of the declaration. Can you set-up a small repo to be able to reproduce/debug? |
The plugin is running, because the styles are being applied. Let me see if I can set up a small test repo. |
@pascalduez Here you go: https://cloudup.com/cLsnx9RtW82 See README for repro steps. |
Yeah, something's up for sure, because changing the buttons.css file doesn't change anything in Chrome, even though Webpack is "rebuilding". |
Maybe it's this? |
@kevinSuttle Is this issue still relevant? |
I tried fiddling with the provided repo for an hour or so, I could not get any progress. Next step would be to try without storybook, just "plain" webpack and an index.html. I'm using cssnext on a projet with webpack n' stuff and have no issue BTW. |
@pascalduez I haven't seen it reproduced. Thanks for checking into it. I appreciate you taking the time. |
Seeing this again now.
Button.css :root {
\--ThemeButtonStyles: {
@apply --ThemeAnimationStyles;
...
} webpack.config.js postcss: function() {
return [
atImport({
addDependencyTo: webpack,
path: './src/Index.css',
plugins: [
customProperties({preserve: true}),
cssApply,
autoprefixer
]
}),
]
}, |
This is concerning enough, even if Webpack 2 is still in beta. Re-opening. |
Let me elaborate on the structure: ./Index.css @import "./Themes/Vars.css";
@import "./Themes/Colors/Kratos.css";
@import "./Themes/Colors/Prometheus.css";
@import "./Themes/Mixins.css"; Each component has it's own CSS file. e.g. Button. Buttons/
Buttons.css is the only component that I am writing a mixin for locally, so maybe that's the repro. :root {
--ThemeButtonStyles: {
@apply --ThemeAnimationStyles; /* From "../Themes/Mixins.css" */
...
}
.btn,
.primaryBtn,
.secondaryBtn,
.pageBtn,
.navBtn {
@apply --ThemeButtonStyles;
...
}
} WARNING in ./~/css-loader!./~/postcss-loader!./src/Index.css
postcss-custom-properties: /Users/kevinSuttle/Code/platform-ui-primitives/src/Themes/Mixins.css:15:5: variable '--PrimaryThemeColor' is undefined and used without a fallback [repeats] This is inaccurate. |
Confirmed. Removing that Or maybe not. I've got another :root {
--ThemeAnimationStyles: {
transition-duration: .2s;
transition-timing-function: cubic-bezier(.075, .82, .165, 1);
}; |
I added the imports in my top-level npm module export: require("./Themes/Vars.css");
require("./Themes/Colors/Kratos.css");
require("./Themes/Colors/Prometheus.css");
require("./Themes/Mixins.css"); And got the slashes back on top-level I still get the warnings from postcss-custom-properties, but the styles work.
Edit: nope. @MoOx, this appears to be an issue with postcss-custom-properties, as it still appears even when I remove postcss-apply. Will open there. |
Hi , I got the same issue with the plugin, it was adding backslashes when I try to import custom property sets from an external CSS file.
I there a better way to achieve this, without those two downside ? part of my webpack ("webpack": "1.13.3") config : postcss: [ |
@Memoyr Just a quick remark on what you posted above, |
That's how |
Same is happening here. For now to get unblocked I've created this |
@ericsaboia I once tried to debug, but the thing is quite dense, there's so many actors involed... |
thanks for looking into this, even though it doesn't seem to be an issue caused by I'm executing When I execute it inside the loaders it works well, meaning the I can set up a minimal reproducible environment to help debug this. |
Also hitting this issue, and also because of |
Okay, I spotted the culprit. This happens when used together with CSS modules. |
@pascalduez no way around this then? |
@yebrahim One solution, PR that lib to prevent the escaping. But since custom property sets are not going anywhere, it might be more difficult to get the change accepted, dunno. I'll try, but feel free to. Currently custom property sets don't have any browser support and will most likely won't get any. |
Any ideas on what could be causing this? I'm not sure it's this plugin, to be honest.
The text was updated successfully, but these errors were encountered: