-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Handle SASS parent reference &: #414
Comments
...in fact, it seems a little inconsistent how the : is handled in nested blocks, even with normal pseudo-class selectors. |
JavaScript: css beautifier checks if the colon it encounters is part of a property: value or part of a nested pseudo-class/ parent reference. In case of nested pseudo-class or parent reference it does not output a space after the colon. Added general test for parent reference, nested pseudo-class and SASS import statement. Added special test for issues beautifier#410 and beautifier#414. Python: Best effort to support parent reference and nested pseudo-class. When it encounters a colon it checks if the colon is part of a property: value or part of parent reference/nested pseudo-class. In case of parent reference/nested pseudo-class it does not output a space after the colon. Added tests for reference/nested pseudo-class. Add tests for issues beautifier#410, beautifier#414 Fixes issues beautifier#410 and beautifier#414 Related to issue beautifier#356
JavaScript: css beautifier checks if the colon it encounters is part of a property: value or part of a nested pseudo-class/ parent reference. In case of nested pseudo-class or parent reference it does not output a space after the colon. Added general test for parent reference, nested pseudo-class and SASS import statement. Added special test for issues beautifier#410 and beautifier#414. Python: Best effort to support parent reference and nested pseudo-class. When it encounters a colon it checks if the colon is part of a property: value or part of parent reference/nested pseudo-class. In case of parent reference/nested pseudo-class it does not output a space after the colon. Added tests for reference/nested pseudo-class. Add tests for issues beautifier#410, beautifier#414 Fixes issues beautifier#410 and beautifier#414 Related to issue beautifier#356
JavaScript: css beautifier checks if the colon it encounters is part of a property: value or part of a nested pseudo-class/ parent reference. In case of nested pseudo-class or parent reference it does not output a space after the colon. Added general test for parent reference, nested pseudo-class and SASS import statement. Added special test for issues beautifier#410 and beautifier#414. Python: Best effort to support parent reference and nested pseudo-class. When it encounters a colon it checks if the colon is part of a property: value or part of parent reference/nested pseudo-class. In case of parent reference/nested pseudo-class it does not output a space after the colon. Added tests for reference/nested pseudo-class. Add tests for issues beautifier#410, beautifier#414 Fixes issues beautifier#410 and beautifier#414 Related to issue beautifier#356
A fix for this would be great, it seems to be the only thing preventing jsbeautify from working with |
+1 I just had this happen, too. I am not familiar with js-beautify source code, so it would take me some time to work out a Pull Request.. Hopefully someone else can resolve this soon! Thank you! |
SASS allows referencing the enclosing parent selector, like this:
as per http://sass-lang.com/documentation/file.SASS_REFERENCE.html#referencing_parent_selectors_
When this is formatted, a space is added after the colon, breaking the syntax.
It would be very convenient if the &: notation was recognized as a special case, and no space added. (Even if it is strictly speaking not valid CSS; the beautifier already handles SASS very nicely otherwise).
The text was updated successfully, but these errors were encountered: