_hyperscript
_hyperscript copied to clipboard
parser error : `on click transition THE closest .card's opacity to 0 over 50ms then remove closest .card` should not mandate the capitalised article
on click transition closest .card's opacity to 0 over 50ms then remove closest .card
gives the following error :

ref :
function parsePseudopossessiveTarget(parser, runtime, tokens) {
var targets;
if (
tokens.matchToken("the") ||
tokens.matchToken("element") ||
tokens.matchToken("elements") ||
tokens.currentToken().type === "CLASS_REF" ||
tokens.currentToken().type === "ID_REF" ||
(tokens.currentToken().op && tokens.currentToken().value === "<")
) {
It's unfortunately required. Consider this:
set color to the first <input[type=color] />
transition color's background-color to 0 -- animates the input
transition color to 'red' -- animates `me`
We parse the code left-to-right, so it's difficult to distinguish how we should continue reading the code after we see color.
We could maybe add a new, simpler syntax:
animate closest .card to { opacity: 0; } over 500ms
The part between the curly braces being a CSS rule.
thanks for weighing in!