On Thu, Nov 24, 2016 at 11:01 AM, John Orford <[email protected]> wrote:
> On the perennial CSS-in-Elm topic - I think Elm's lack in this regard > reflects a general lack of being able to do CSS in an elegant manner > (correct me if I am wrong). > > I am pretty sure if there was a clear way to do CSS right generally, Elm > would've jumped on that band wagon. > > Having said all that, I'd love to hear suggestions on how best to do CSS, > in an Elm context or not... > CSS is part of a theory about how to do documents. It predicates a split between what is content and what is presentation of said content. This is all fine in a typical document like web page. In a webapp things might need to be reconsidered. I'm not a CSS guru but from the outside of industry it looks like there are two main concerns: layout and visuals. My guess is that more than 80% of the trouble of CSS are generated by troubles in the layout domain so... that would be a low hanging fruit. A clear split between layout and visuals (skeleton and surface) could allow the the creation of a layout library that does just that: layout but in a very considerate and intelligent way. A second concern regarding CSS is at a higher level of abstraction and relates to encapsulation of layout and styling information together with behavior. This is the realm of what one can see in Polymer where components encapsulate everything. To give you a more visual example, imagine some kind of ripple button that can be used instead of Html.button and does not require mounting of outside CSS or declaring some class and style attributes. It can be done with webcomponents/polymer by going outside of Elm but it is cumbersome. -- There is NO FATE, we are the creators. blog: http://damoc.ro/ -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
