-
Notifications
You must be signed in to change notification settings - Fork 51
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
[dom2] Can't set CSS custom properties #39
Comments
the js API generally used to set CSS vars is EDIT: having looked at the closure library, it doesn't seem to do anything useful and was probably added before setProperty was standardized (ca 2012). |
Implemented for CSS vars. But not for all properties, e.g.
|
I don’t know if If |
Personally I'd see |
dom2/style
will only set properties thatgoog.style/setStyle
recognises - anything else silently vanishes. This makes it impossible to use custom properties ("CSS variables"), and seems to affect browser-prefixed props too (I quickly tested-moz-transition
, might be wrong about this).Here are 2 attempts that don't work:
And one attempt that did:
One possible fix might be for
dom/set-property!
to join style rules into ak: v; k2: v2
form and useset-attribute-ns
to inject them as a string. It feels slightly hacky, and perhaps bypasses some clever internals of Google Closure (?), but it would solve the problem without styles overwriting oneanother.(PS: I'm enjoying Electric v much, I'm not a dev, don't work in tech, and never used Clojure beyond toy examples, but Electric has revived my enthusiasm for a personal project that I abandoned last year. Thank you for everything!)
The text was updated successfully, but these errors were encountered: