Closed nuFaqtz closed 6 years ago
You expect ui.explorer|dock.explorer
? Do you want to send PR?
Expect ui|dock.explorer
OK. I will look on Friday.
Can you give me some link about |
in selectors?
Thnx, https://developer.mozilla.org/nl/docs/Web/CSS/@namespace
Again, it did work as expected in 2.0.2
I added you case to tests and got:
ui|dock.explorer {
float: none;
}
Maybe |.
came from other tools? Can you create some small project to reproduce the error?
Also try to update postcss-selector-parser
to latest version.
Thnx for checking it and I ran the test and indeed the result was as you say. However, I checked my css to see why I created this issue in the first place and found out that the provided test was not complete. The actual css that fails is
ui|dock {
&.explorer {
ui|docktab {
float: none;
}
}
}
Notice the nested namespaced item and this will result in:
ui|dockui|.explorer ui|docktab {
float: none;
}
Standard environment test:
Just add the following to index.test.js:
it('nested namespaced selectors processed the wrong way, with a copied | character', () => {
return run(
'ui|dock { &.explorer { ui|docktab {} } }',
'ui|dockui|.explorer ui|docktab {}');
});
it('nested namespaced selectors processed the right way', () => {
return run(
'ui|dock { &.explorer { ui|docktab {} } }',
'ui|dockui.explorer ui|docktab {}');
});
The first on validates - while it test against the wrong result (with the |) The second one fails as the correct output is not precessed.
Thanks.
I will try to fix it today, so it will pass this test (check that it is correct test):
it('supports namespaced selectors', () => {
return run(
'ui|dock { &.explorer { ui|docktab {} } }',
'ui|dock.explorer ui|docktab {}');
});
Yep, that's the correct one. Mucho thanks for taking the time. Keep up the good work!
JamBo
The problem is inside selector parser. I opened a issue: https://github.com/postcss/postcss-selector-parser/issues/114
Issue was fixed in selector parser, but we are waiting for next 3.0 release.
There is blocking issue with Stylelint.
Selector parser 3.0 was released and I updated dependency https://github.com/postcss/postcss-nested/commit/d76950cd2673093b0497f4dc8f7a3a34abea3c5e
Released in 3.0
Version 2.04 When using namespaced selectors like:
the result is:
Notice the extra '|' In version 2.02 this worked correctly.