<div dir="ltr"><br><br><div class="gmail_quote">On Thu, Aug 5, 2010 at 3:41 PM, Tim Matthews <span dir="ltr"><<a href="mailto:tim.matthews7@gmail.com">tim.matthews7@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Thu, Aug 5, 2010 at 11:33 PM, Mark Bradley <span dir="ltr"><<a href="mailto:barkmadley@gmail.com" target="_blank">barkmadley@gmail.com</a>></span> wrote:<br><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
but CSS type checking might be possible within hamlet.<br></blockquote><div> </div></div><div>I have often wondered "OK haml implemented now what about sass". Michael Snoyman what is your opinions on sass? Would a sass inspired syntax like you did with the haml->hamlet fit in well and if so, as it often best to keep styles separate, could a quasi quoted language live in in a separate haskell module and then at run time it recreates the separate css files on first launch?<br>
<br></div></div></blockquote><div>After looking into sass a little bit, I've decided I like it ;). I see the following benefits of implementing something sass-like in Haskell via quasi-quotation:</div><div><br></div>
<div>* Compile-time guarantee of well-formedness.</div><div>* The speed benefits of blaze-builder. Of course, this will still be slower than serving a static file.</div><div>* Ability to use the same Haskell variables for both Hamlet and CSS.</div>
<div><br></div><div>I've started a new repo on Github[1]; I'm tentatively calling the project "stylish". So far, I've gotten a quasi-quoter that handles nesting working, and it's all built on top of blaze-builder. Here's some design decisions that are up for grabs:</div>
<div><br></div><div>* I think the older sass syntax (whitespace sensitive) is a better call than the newer scss syntax (a superset of CSS). It fits in better with Hamlet and looks more like Haskell code.</div><div>* I'm not planning on implementing variable declarations within a Stylish template; instead, it will use Haskell variables like Hamlet.</div>
<div>* I think mixins could be an awesome feature, but I think they'll be implemented much closer to how embedding of templates works in Hamlet. I'm thinking there will be a separate stylishMixin quasi-quoter.</div>
<div>* Sass has special support for colors and unit measurements. I think we could provide the same thing with Haskell datatypes.</div><div><br></div><div>Another thing to consider is just throwing this in with Hamlet; once blaze-html 0.2 is released and is based on blaze-builder, Stylish won't be adding any extra dependencies to Hamlet.</div>
<div><br></div><div>I also think that the three forms of interpolation in Hamlet ($$, @@ and ^^) make equals sense in Stylish: just imagine using url(@myUrl@) and not having to guess how many parent directories to ascend.</div>
<div><br></div><div>Michael</div><div><br></div><div>[1] <a href="http://github.com/snoyberg/stylish">http://github.com/snoyberg/stylish</a></div></div></div>