-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Improve selectors parsing for nth-child binomials #1197
Conversation
My issue with this is that it's unclear when/if compressed should be used. It's another undocumented mystery flag that noone understands. IMHO this issues isn't of any importance atm so we can defer it until 3.4 with the rest of the whitespace issues. By then we should have a better idea of if there are more usecases for compressed (I don't think there are from reading the Ruby code). |
I somewhat agree, but I can explain quite clearly what that flag does. It removes all whitespace from the string if it is emitted to css in compressed mode. This is not really familiar with any other node. So not sure what to do with it. I thought about a specific ast node for binomials, but I still would need to preserve the full parsed string, since ruby sass really preserves the whitespace (it does not just add one optional space as other nodes). Or it would basically be another string type doing exactly what the new "compress" flag is doing ... I somewhat disagree to postpone this. The result seems promising to be on par with ruby sass. I tend to search the code for these specific flags to see where they are used. So far this flag is really specific to binomials. As you see I pretty much fixed all other white space issues, so we probably can label the next bugfix release a "white-space" release, so I vote to include this. Of course I'm always open to have the option named differently and/or add some description! |
The concerns here are too mixed up IMO. Fixing an issue with binomials-like expressions in selectors by changing how we output strings? At the very least the output logic should be scoped to selectors, at which point we could use context, rather then some mystery flag. This at least signals to the reader what the intent is. |
Even renaming the |
Renamed the flag to |
This is an improvement 👍 |
Improve selectors parsing for nth-child binomials
Fixes #593
Implementation may not be the cleanest, but maybe we find more use cases where "compress" can be applied to String Constants. Then we may get a better picture how we can implement it better.