purescript-web/purescript-web-html

Create common ClassName to share among all frameworks

Closed this issue · 4 comments

We could achieve compatibility improvements between web frameworks and CSS frameworks by defining a common ClassName that they can all share.

Proposing that we move this Halogen definition of ClassName to web-html (or similar common location):
https://github.com/purescript-halogen/purescript-halogen/blob/c8b50378b948fcba9e10d75da718fc7dae3a609f/src/Halogen/HTML/Core.purs#L188-L194

It would probably also be good to have the append instance as join with a space delimiter.

garyb commented

Adding that here sounds good to me.

I've always resisted having ClassName as a Semigroup in Halogen though, as I prefer knowing ClassName is just one class, so that way you don't need to split it up again and stuff if you want to filter classes or things like that.

I see the Semigroup proposal came up before purescript-halogen/purescript-halogen#512

And the current system of class_ and classes seems to work pretty well.

I prefer knowing ClassName is just one class

There don't seem to be a lot of guarantees about this, as someone could define a ClassName as "class1 class2", but then that's fine just being their own problem then.

Should AttrName and PropName also be moved to this common location?

I think this was closed by #30