On the subject of property extraction, I am -1. Pertinent to the general discussion, here's a blog post I wrote about how we approach the Sass language design process and the thought process we go through:
http://chriseppstein.github.com/blog/2010/08/16/sass-language-design/ The goal should not be less lines of code, but rather more maintainable code. Sure you can save a little typing by extracting a property, but as Nathan pointed out there's a lot of opportunities for unmet expectations with such a feature. They might expect the cascade to apply or they might make a change to an extracted property and not realize or want that change to propagate. When these unexpected things happen, the time savings of not refactoring to extract a variable (which has a very clear purpose for re-use) is lost tenfold. Chris On Fri, Mar 18, 2011 at 11:42 PM, Alexander Sergeyev <[email protected]>wrote: > Since Sass is a CSS3 superset, @import "foo.css" must work as it does in > CSS > > > Nathan, > we're agree that @import "foo.css" should work as it does in CSS, there is > no contradiction with my proposal. Proposal is just and only about extending > of @import "foo". This command is SASS-specific, so it wouldn't ruin the > consistency if you allow one more extension besides .sass and .scss to be > processed. Again to sum up: > > @import "foo.css" will work as it does in CSS > @import "foo" will include contents of foo.(sass|scss|css) > > > Variables tend to do nearly as good a job of reducing the repetition in > every case we've seen. > > > And here I speak of the feature extensively used via LESS previously, not > dreamy one.Think of properties as already defined variables. In this way > you're not pushed to define variable for every repeated property. Especially > in minor cases when it should be repeated no less than twice or thrice. > Let's compare. > > > $body_lineheight: 1.5; > $paragraph_color: #999; > body { line-height: $body_lineheight; color: #111; ... } > p { line-height: $body_lineheight; color: $paragraph_color; ... } > li { color: $paragraph_color; ... } > > body { line-height: 1.5; color: #111; ... } > p [ line-height: body['line-height']; color: #999; ... ] > li { color: p['color']; ... } > > -- > You received this message because you are subscribed to the Google Groups > "Haml" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > -- You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/haml?hl=en.
