how to construct a compass sass with high efficien

2019-09-19 14:13发布

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.
enter image description here

1条回答
Root(大扎)
2楼-- · 2019-09-19 15:03

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:

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;.

查看更多
登录 后发表回答