TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why use HAML (and SASS) if you already know HTML?

62 点作者 r11t超过 15 年前

8 条评论

aaronbrethorst超过 15 年前
Why should I use C since I already know Assembly? Why should I use Ruby since I already know C?<p>Haml and Sass are elegant tools for simplifying view code, and I never, ever use ERB or CSS anymore if I can avoid it.
评论 #1096599 未加载
评论 #1096889 未加载
评论 #1098416 未加载
retro超过 15 年前
James Britt wrote the definitive post (in my opinion) on the use of Haml: <a href="http://www.jamesbritt.com/2009/4/29/thoughts-on-haml" rel="nofollow">http://www.jamesbritt.com/2009/4/29/thoughts-on-haml</a>
评论 #1096694 未加载
评论 #1096777 未加载
评论 #1096688 未加载
评论 #1097628 未加载
marstall超过 15 年前
If you're a one-man team who does the whole stack on your own personal project, something like HAML might be for you.<p>However I have to say, in 10+ years of working on multi-person, multi-discipline web teams, there isn't one to whom i could see having recommending something like HAML.<p>Just raises too high a bar for designers and front-end developers (ie CSS/HTML specialists), for whom learning a new language is actually a fairly big deal.<p>SASS seems to be enough like CSS that it wouldn't necessarily pose a comparable problem to the designer brain. I could see designers grokking its basic features like variables and seeing them as a thing that gave them more power.<p>If my experience is representative, though, configuration might be SASS' achilles heel right now. Really gave it the ol' college try and my SASS files never QUITE seemed to compile how and when i expected. Compass was even worse in that regard for me. I am getting old though, so maybe i've just lost a step or two :) Anyone else have similar experiences?
评论 #1097175 未加载
chrischen超过 15 年前
A lot of IDEs/text editors can autocomplete HTML closing tags, so I find the comparison based on characters moot.<p>I'll admit it might make things easier to navigate with the eyes. But on the other hand it seems to abstract something that's really not that complicated to begin with.
评论 #1096884 未加载
评论 #1096855 未加载
richardburton超过 15 年前
I've only been using HAML &#38; SASS for around a month and I'm by no means an expert. I've found that using mixins saves me a lot of time. At the top of my stylesheets I lay out bits that I repeat a lot such as:<p><pre><code> =rounded-corners(!amount) border-radius= !amount -moz-border-radius= !amount -webkit-border-radius= !amount </code></pre> And then add them into the UI:<p><pre><code> .curvybox +rounded-corners(7px)</code></pre>
brunoc超过 15 年前
An alternative to SASS, if you are looking for one, is "less" (<a href="http://lesscss.org/" rel="nofollow">http://lesscss.org/</a>).
zaius超过 15 年前
Good luck giving that to a designer.
评论 #1096718 未加载
评论 #1097186 未加载
seven超过 15 年前
I do not use HAML in my projects because it is much easier to find somebody who can understand 'html-templates'.
评论 #1096719 未加载
评论 #1096767 未加载