Switch camel-to-kebab case convertion in v helper

Calling as a function will no longer do the transformation, but instead
indexing the proxy will do this now.
This commit is contained in:
Talia 2021-10-19 20:03:48 +02:00
parent b5ab9fafdb
commit f5f3794006
No known key found for this signature in database
GPG key ID: AD727AD22802D0D6

8
css.js
View file

@ -38,7 +38,9 @@ const mkVar = name => {
return v return v
} }
export const v = new Proxy(Window, { export const variable = new Proxy(Window, {
get: (target, name, receiver) => mkVar(name), get: (target, name, receiver) => mkVar(keyToPropName(name)),
apply: (target, object, [name]) => `var(--${keyToPropName(name)})`, apply: (target, object, [name, value]) => value
? `var(--${name})`
: `var(--${name}, value)`
}) })