问题
I am a beginer of compass sass,I want to know how to how to construct a compass sass project with high efficiency. Is there any existed compass sass framework in github . Or can any experienced developer suggest me how to write a good compass sass project .Thank you very much.

回答1:
Various frameworks have been ported to work with Compass, but I don't recommend them. The common CSS frameworks are built to be one-size-fits-all, because that's the best you can do with a pre-set list of CSS classes. With Sass you can build much more targeted and flexible tools, and then combine them all in unique ways using Compass.
There are several already-answered SO questions that are relevant to what you are asking:
- Using Compass/Sass with another CSS framework for more on frameworks.
- SASS: Extending Classess vs Variables for more on using
@extends
. - Structuring CSS (SASS, LESS) files by elements, by function and by media queries: 3D code structure? for more on organizing your code.
Keep mixins and silent classes (like %mgb5
) as simple as possible without losing meaning. It's a good rule for classes in general. nav
is short and still easy to understand, mgb5
is not as much. The same rule can guide you inside the mixin/class. If you only have one property, the mixin/class may not mean much. If you have thirty, it's probably trying to do carry too much meaning. Split larger mixins/classes into smaller ones for more flexibility, as long as each one represents a distinct and meaningful action.
The same basic guidelines apply for static css vs. variables. If any rule has a purpose that isn't clear in the plain css, then it should become part of a mixin, function, or variable that gives it the desired meaning. If 18px
is just a size that seems good to you for now, 18px
is just fine. But if 18px
is part of a set scale of sizes, or has a specific purpose, name it: $large: 18px;
or $gutter-width: 18px;
.
来源:https://stackoverflow.com/questions/13282112/how-to-construct-a-compass-sass-with-high-efficiency