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
1 changed files with 5 additions and 3 deletions

8
css.js
View File

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