I understand how using Elm for CSS might look like a case of "I've got a
hammer..." and the external CSS has its merits, especially when it comes to
transitioning from a traditional HTML+CSS+JS to Elm.

CSS in Elm comes with its own set of advantages and, in the long run, I
think it might be a way better option.
It can use types to make sure that changes to IDs or Classes are consistent
throughout. Named values can make for an additional line of defense against
typos.
It has way better composition and much more flexibility due tot the fact
that one can create style on the fly based on information from the
environment (e.g. device size and/or DPI).





On Thu, Jun 2, 2016 at 11:30 AM, Tim Stewart <finelinestu...@gmail.com>
wrote:

> Ondrej's approach makes sense to me too. The advantages Elm brings to the
> table - ensuring program validity, eliminating runtime errors and issues
> related to mutable state etc. - just aren't really problems in CSS. The
> shortcomings that CSS does have are mainly addressed by LESS, it's quick
> and easy to iterate by copying styling experiments in the browser directly
> back to source, and I'm guessing it's a smoother workflow when
> collaborating with designers, embedding into existing sites etc. Using Elm
> for CSS seems to me a bit like a case of "I've got a hammer...".
>
>
> On Thursday, June 2, 2016 at 4:48:35 AM UTC+10, Ondřej Žára wrote:
>>
>> I used Elm.embed, static <link rel="stylesheet"> in my parent document
>> and (obviously) an external stylesheet, preferrably using a Less
>> preprocessor.
>>
>> O.
>>
>> On Tuesday, May 31, 2016 at 11:26:37 AM UTC+2, Peter Damoc wrote:
>>>
>>> How do you handle styling in your Elm programs?
>>>
>>> Do you use one of the following libraries?
>>>
>>> rtfeldman/elm-css
>>>
>>> seanhess/elm-style
>>>
>>> massung/elm-css
>>>
>>> Or do you do something completely different (manual style inlining,
>>> classes and external css) ?
>>>
>>> I tried using Sean's library but I quickly ran into pseudo-selectors
>>> trouble wanting to implement a simple hover effect.
>>>
>>> Somehow, keeping a set of hover states for some simple nav-link seams
>>> such an overkill.
>>>
>>> How do you handle such scenarios?
>>>
>>>
>>>
>>> --
>>> 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 elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to