Assuming you are dealing with client-side HTML, and have opened IntelliFactory.WebSharper.Html.Client, all HTML attributes are under Attr.*. Most of these are also exploded into the parent namespace, but indeed Class and a handful of other attributes are not for name collision and other reasons.

So for Class, use Attr.Class such as:

Div [Attr.Class "class1 class2"] -< [... content ...]

As a side not, if you use Div [Attr.Class "class1"; Attr.Class "class2"] -< [...], you will be losing the first class attribute. We might be revisiting this design decision while in alpha to actually collect all annotated classes together.

By on 2/18/2015 6:23 PM ()

Got it. The concern was not a special semantics of the class= in HTML, rather possible conflicts when exporting the name Class.

I think that your current approach to attributes makes the most sense. I do not think that class= would deserve a special handling (like acumulating values rather than overriding). This alone would not achieve anything useful and only cause confusion, I believe.

By on 2/19/2015 11:18 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper