-
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
Using this after postcss-nested breaks the plugin #16
Comments
hi, could you please but a little bit more specific/clear (samples welcome). |
So i put When using this plugin
But if this plugin is used after
This makes these properties Does that help at all? |
All right, still a bit weird, but I'll try to reproduce and see what we can do to make both plugins play together. But the issue looks more on the postcss-nested part at a first glance. Side not: what about |
I've not tried |
Hi, I'm having a similar issue. I'm using postcss-apply v0.6 because I need to have sets in JS. However I also need to create sets in css and do something like this:
The problem is that it won't render the nested title properties. I guess this is a issue between the apply and the nested plugins, because if I manually update the cssnext to use apply in v0.6 it all works great. Can you help me workaround this issue until cssnext updates the apply plugin? This is my implementation: Package:
Postcss Plugins:
Thanks |
Hi @ritasousa-farfetch, I'll try to run some tests, see what we can do. As far as I can tell, custom property sets name interpolation is not part of any spec. --bar {
color: #ffffff;
&-title {
color: #f8f8f8;
}
} So bascally, this won't be added to the Not to shirk reponsabilities, but at a first glance this looks more like an issue for To be honest, what's so terrible about the following? :root {
--bar {
background: #000000;
color: #ffffff;
}
--title {
color: #f8f8f8;
}
}
.foo {
@apply --bar;
}
.foo-title {
@apply --bar;
@apply --title;
height: 30rem;
} |
I agree i don't think :root {
--bar {
background: #000000;
color: #ffffff;
&-title {
color: #f8f8f8;
}
}
} Will work, you can use: https://github.com/andyjansson/postcss-sassy-mixins like i do with @mixin bar {
background: #000000;
color: #ffffff;
&-title {
color: #f8f8f8;
}
} |
Thanks for your quick answers. It worked before disabling the applyRule in the cssnext and requiring apply separately to use v0.6. You can test it in the cssnext playground, the exact same css renders to:
I've tried to run nested before the apply but it doesn't even recognise the set.
|
@ritasousa-farfetch Okay, I see. Did you try just upgrading the So basically just a So back at what I supposed your config was: plugins: [
require('postcss-import'),
require('postcss-reporter'),
require('postcss-mixins'),
require('postcss-cssnext')({
features: {
customMedia: {
extensions: mediaqueries,
},
customProperties: {
variables: variables,
},
autoprefixer: {
browsers: ['last 2 versions'],
remove: false,
},
calc: {
preserve: true,
},
apply: {
sets: sets,
},
rem: false,
},
}),
], |
Also the plugin |
Thanks so much for your help. The last solution would work but not on a production environment, as the dependencies are all reinstalled with the tags. Maybe not using nested sets is the way to go, as you said they're not in the standard specs. |
@ritasousa-farfetch Okay, I'll try to make cssnext update the dependency ;) For the prod env, maybe a "scripts": {
"postinstall": "npm i postcss-apply@latest"
} |
The problem it causes is:
On this line https://github.com/pascalduez/postcss-apply/blob/master/src/visitor.js#L16, normally it looks like:
--toolbar-theme:
but withpostcss-nested
it looks like::root --test-theme: null
.Moving it before
postcss-nested
fixed it for me so might be worth mentioning that somewhere in the README :)The text was updated successfully, but these errors were encountered: