-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StyleAttr.cssFloat should use the float css property name #187
Comments
Hm, with include karax / prelude
import karax/vstyles
proc createDom(): VNode =
result = buildHtml(tdiv(style = style((StyleAttr.cssFloat, kstring"right")))):
text "Hello World!"
setRenderer createDom I get <div id="ROOT" style="float: right;">Hello World!</div> on the current master branch of Karax. <div style="css-float: right; ">Hello World!</div> which seems to match your issue. Not sure what the best fix here is. An easy one is just a hack to check and see which backend is being used, and translate accordingly. My guess is that this is the only CSS property with this issue, I glanced through the other ones that Karax provides and those seemed fine. Suggested workaround: proc createDom(): VNode =
result = buildHtml(tdiv(style = "float: right;".toCSS)):
text "Hello World!" It is possible to directly set the style using Karax. |
Yes, I'm using Karax to generate HTML in this case. |
@Araq is there any situation where if there's no such situation, should we migrate the code in karax to use |
Can't remember, but what I do remember: The style handling code is most performance critical and can easily dominate the performance profile in a real-world app, not just in benchmarks. You probaly need to make |
then maybe it's time to merge nim-lang/Nim#15528 (const now works with ref types) ? There are so many use cases for it (including table at CT, jsonNode at CT etc); (so that (note that addressable const should not use |
When I use StyleAttr.cssFloat the resulting CSS style name is css-float when it should be float.
The text was updated successfully, but these errors were encountered: