Closed Qix- closed 5 years ago
To be clear, I realize this isn't your fault. Pseudo elements aren't supported from javascript and have to be hacked in. I just wish there was a better way. :|
Not sure if that spread problem is related to pseudo-styles. Only a guess, but it's almost like the surplus compiler is only checking for fn attributes at compile time and in this case the fn attribute would only be resolved at runtime. That would explain why Surplus can support multiple fn attributes with the same name.
That's a very good guess.
And right, the spread isn't directly related to pseudo styles. It's just my use case is adding them. However, upon further testing, pseudo styles from JavaScript are nearly impossible to do elegantly. I ended up using CSS variables instead.
Alternatively, allow us to use
:before
and:after
in our scripts 🙃I'm trying to get the following wrapper to work:
The
style
attribute gets applied just fine, butfn
seems to be ignored.Here's a simpler example:
In the above, only
first
is printed to the console.By the way, this is all stemming from the fact there's no documented way to use pseudo-styles on elements :/