Re: [elm-discuss] Adding CSS produced by a view function to the document's

2017-06-06 Thread Francesco Orsenigo
Coupling view and style is not the problem, it's the *goal*. Right now, you can't declare CSS in the place where you use it: you need to create a separate stylesheet with references, use those references in your view and then put the stylesheet somewhere. This is not how we write all the rest

Re: [elm-discuss] Adding CSS produced by a view function to the document's

2017-06-06 Thread Peter Damoc
It seams that you have driven yourself into a corner because of a series of choices that you made with your code architecture. The best way forward is to refactor you code so that you decouple the style from the view. You should be able to get both of them from the model independently. Once

[elm-discuss] Adding CSS produced by a view function to the document's

2017-06-05 Thread Francesco Orsenigo
I am experimenting with view functions that produce both html content and the style that should be applied to that markup, as in myView : Model -> ( Html msg, List CssRule ) So far, I have been rendering the above by creating a