* add toCss: allows tdiv(style = "font-style: oblique; color: pink".toCss) * fixup to work with nim c
17 lines
550 B
Nim
17 lines
550 B
Nim
include karax / prelude
|
|
import karax / vstyles
|
|
|
|
proc createDom(): VNode =
|
|
result = buildHtml(tdiv):
|
|
tdiv(style = style(StyleAttr.color, "red".cstring)):
|
|
text "red"
|
|
tdiv(style = style(StyleAttr.color, "blue")):
|
|
text "blue"
|
|
# explicit `kstring` required for varargs overload
|
|
tdiv(style = style((fontStyle, "italic".kstring), (color, "orange".kstring))):
|
|
text "italic orange"
|
|
# can use a string directly
|
|
tdiv(style = "font-style: oblique; color: pink".toCss):
|
|
text "oblique pink"
|
|
|
|
setRenderer createDom
|