about summary refs log tree commit diff stats
path: root/src/css/values.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/css/values.nim')
-rw-r--r--src/css/values.nim15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/css/values.nim b/src/css/values.nim
index c6f0d50c..6533c7f1 100644
--- a/src/css/values.nim
+++ b/src/css/values.nim
@@ -421,18 +421,21 @@ func `$`*(val: CSSComputedValue): string =
   else:
     result = $val.v
 
-macro `{}`*(vals: CSSComputedValues, s: string): untyped =
-  let t = propertyType($s)
+macro `{}`*(vals: CSSComputedValues; s: static string): untyped =
+  let t = propertyType(s)
   let vs = ident($valueType(t))
   return quote do:
-    `vals`[`t`].`vs`
+    `vals`[CSSPropertyType(`t`)].`vs`
 
-macro `{}=`*(vals: CSSComputedValues, s: string, val: typed) =
-  let t = propertyType($s)
+macro `{}=`*(vals: CSSComputedValues, s: static string, val: typed) =
+  let t = propertyType(s)
   let v = valueType(t)
   let vs = ident($v)
   return quote do:
-    `vals`[`t`] = CSSComputedValue(v: `v`, `vs`: `val`)
+    `vals`[CSSPropertyType(`t`)] = CSSComputedValue(
+      v: CSSValueType(`v`),
+      `vs`: `val`
+    )
 
 func inherited(t: CSSPropertyType): bool =
   return InheritedArray[t]