about summary refs log tree commit diff stats
path: root/src/css/cssparser.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-19 14:40:26 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-19 14:43:01 +0100
commitad119c9a299458b4beca9fe8da85f74a33a8d91b (patch)
tree207bcec7e1a43db4754e97898146e0ff491390c7 /src/css/cssparser.nim
parent30e3ff6d8d77adc05db79ace1ed54beb609eb84d (diff)
downloadchawan-ad119c9a299458b4beca9fe8da85f74a33a8d91b.tar.gz
dom: CSSStyleDeclaration improvements
Now getComputedStyle works with pseudo-elements too.
Diffstat (limited to 'src/css/cssparser.nim')
-rw-r--r--src/css/cssparser.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/css/cssparser.nim b/src/css/cssparser.nim
index 94067d24..29ef455c 100644
--- a/src/css/cssparser.nim
+++ b/src/css/cssparser.nim
@@ -100,8 +100,10 @@ proc `$`*(c: CSSComponentValue): string =
         result &= c.cvalue
       else:
         result &= "<UNICODE>"
-    of cttDimension, cttNumber, cttINumber, cttIDimension:
+    of cttDimension, cttNumber:
       result &= $c.nvalue & c.unit
+    of cttINumber, cttIDimension:
+      result &= $int32(c.nvalue) & c.unit
     of cttPercentage:
       result &= $c.nvalue & "%"
     of cttColon:
@@ -122,7 +124,7 @@ proc `$`*(c: CSSComponentValue): string =
       result &= $s
     if decl.important:
       result &= " !important"
-    result &= ";\n"
+    result &= ";"
   elif c of CSSFunction:
     result &= $CSSFunction(c).name & "("
     for s in CSSFunction(c).value: