-
Notifications
You must be signed in to change notification settings - Fork 73
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
Render to key/value pairs #208
Comments
That's a cool idea. What data structure would you propose clay should render to? |
In my particular case I'm interested in getting a |
Yep, that makes a lot of sense. You mean https://hackage.haskell.org/package/miso-0.21.2.0/docs/Miso-Html.html#v:style_, right? Clay itself basically collects a list of I'm not sure this should be part of the |
That can be a long-term goal, but let's first solve the immediate problem and connect clay to miso. The next step can be refactoring and connecting to other frameworks. |
Yes!
Exactly, I had looked for that in the code of clay but it seems that such an intermediate map doesn't exist: the list of rules is converted to a Builder immediately.
That would be definitely simpler at first. But don't you think a function of type |
No, this map doesn't exist yet, someone needs to implement it. Maybe you? :D
It would make more sense if the resulting map is used in some way, but I can't see how the map is sufficient information to recover the whole well-readable rendering that clay produces. clay outputs human-readable CSS, but such a map is too much of a machine format, I think. But let's start with a small step first, and implement the function. As you suggest, let's add it to
Hmm, I think that's best done as a separate endofunction either on |
Actually I don't think we can do without it: other than |
Actually, the low-level constructors for attributes are public in Miso, so I guess I could define my own style attribute that takes a |
My bad, haddock makes it look like the low-level constructors are exposed but they aren't. |
@polux FWIW Here is a hacky way to integration Miso and Clay that I came up with a while back, it worked well enough for a medium-sized project with lots of client-side stuff:
|
This issue has not seen any activity in a long time. If no further activity occurs, it will be closed after ten weeks. |
It would be great if in addition to rendering to text, clay could also "render" to something more structured. That way it could be used as a DSL for inline CSS in combination with libraries like miso for instance.
The text was updated successfully, but these errors were encountered: