-
Notifications
You must be signed in to change notification settings - Fork 3.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
Recognize :hover and put it at the end of selector #1942
Comments
This has come up before and maybe we should consider correcting the selector and moving the hover pseudo selector last. First I'd like to research if this should happen to every pseudo selector just a group of them. If its every pseudo I'd feel more inclined to do it. |
Doesn't this affect all pseudo selectors, not just :hover? |
I don't think we should reshuffle |
+1. |
@matthew-dean are you sure about that, can you give an example? This isn't shuffling pseudo selectors across elements, only on the same element so it appears after classes e.g. I don't think it changes the meaning (that's what I want to confirm), so a counter example would allow us to close. |
For the reference: |
So is this just an aesthetic request? |
Probably it was not initially. Honestly I also did not know In fact I'm in great doubt about this feature, while I think it really could be something useful my concerns are the same as in more reasonable #1605 (where the result is actually an invalid CSS): by reshuffling we'll open that "I wrote A but actually I did mean B so can Less fix it for me?" pandora box with no evident point of where to stop and close it. (Not counting those harsh sarcastic examples like "pozition: fixet;" - should Less fix that too? :) just a few additional remarks to consider: (1). The same story applies to:
Should we reshuffle this too? (2). If such selector is written explicitly (e.g. just (3). Implementation: For proper redordering we'll have to hardcode all the (4). I'm also concerned if such reshuffling will eventually make other features more complicated to implement, in particular And btw., all above w/o counting that there're several ways to get the desired styles without #1075 or so. |
@lukeapage Yes, my concern was more similar to @seven-phases-max's. That is, in the example given, it seems reasonable, but a step in any direction, and the choices become less clear. I like when we exercise caution to make the parser, in general, output in a predictable and consistent fashion. If it reorders based on special text, it does fork output behaviors. I know we have to do that in some areas (like calc()), but I just think it's prudent to be conservative about behavior forking. |
But, since you asked for it, I came up with a more obvious example:
The correct (and only valid) order is |
I am not talking about appending |
@mohebifar In your example, you stated ":hover's place is not right in output." Yet :hover is correct based on your usage of |
closing due to lack of response |
It seems there's something unseen in LESS to me. I expect something like this in CSS:
my LESS is :
But what I get is :
:hover's place is not right in output.
The text was updated successfully, but these errors were encountered: