-
Notifications
You must be signed in to change notification settings - Fork 196
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
Resolve multiple sibling pseudo classes correctly #142
Conversation
The tests seem to be failing because of something in |
I will paste the fixtures and it's output here for ease of reading: pseudo classes: [ (#) Page
[ color (hex "#fff")
, hover
[ marginTop (px 10)
, focus
[ color (hex "#000") ]
]
, first
[ fontSize (em 3) ]
, disabled
[ marginTop (px 20) ]
]
] #Page {
color: #fff;
}
#Page:hover {
margin-top: 10px;
}
#Page:hover:focus {
color: #000;
}
#Page:first {
font-size: 3em;
}
#Page:disabled {
margin-top: 20px;
} |
@tolgap wow nice! I just upgraded the test dependencies on |
864ee7f
to
0c98bf6
Compare
@rtfeldman rebased on |
😻 😻 😻 This looks fantastic! Really appreciate it @tolgap! |
@tolgap it looks like the second bug reported in #136 is still at large. I reproduced it with a test case in b2a1968 (on branch |
@rtfeldman Forgot to include the explanation for that in my initial post... I indeed could not resolve the second bug in #136 . That second issue is... quite hard to solve if I dare say 😨 . I do have some more time right now to look further into the second bug. |
This PR aims to fix issue #136 .
The issue was: when resolving multiple sibling pseudo classes like:
the code written would resolve
a
, and next up, it would resolvea:hover
and since:hover
is a complete new styleblock definition, it got appended to the list of styleblock declarations. What happens next is that:active
would get resolved, but since the latest styleblock is now ana:hover
, it would think it's a nested pseudo class.I have fixed this issue, by popping the last declaration, and using that to resolve pseudo classes. And in the end, using
List.tail
to get rid of thea
declaration. This seems to fix my issues, and the issue shows in #136 as you can see in the written tests for this.@rtfeldman since this issue was assigned to you, did you have any other concerns about this?