使用Compass / Sass与另一个CSS框架 [英] Using Compass/Sass with another CSS framework

查看:134
本文介绍了使用Compass / Sass与另一个CSS框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用Compass / Sass用于我的CSS编码,它已经很好地工作了。我现在正在试图尝试不同的框架(Skeleton,Foundation,Bootstrap等)。
我的问题对于那些有经验的使用Compass,当你安装一个新的框架,它包括它自己的css文件与现成的类。当您使用Compass时,它具有您用来修改类和变量的scss文件。让我困惑的事情是,我需要去css文件修改任何默认类,然后回到scss文件为了做混合,变量等,它似乎真的是多余和耗时。

I recently started using Compass/Sass for my CSS coding and it has been working out well. I am now looking into trying out different frameworks (Skeleton, Foundation, Bootstrap etc.). My question for those who are experienced with using Compass, when you install a new framework, it includes it's own css file with ready-made classes. When you use Compass, it has the scss file you use in order to modify classes and variables. The thing that is confusing me is that I would need to go to the css file to modify any of the default classes, then go back to the scss file in order to do the mixins, variables, etc and it seems really redundant and time consuming.

我应该剪切css文件中的所有内容并将其粘贴到scss文件中以使其更容易吗?或者有一个不同的方法,我应该做,如果我想使用一个框架,如Bootstrap与Compass?

Should I be cutting everything in the css file and pasting it in the scss file to make it easier? Or is there a different method I should be doing if I want to use a framework such as Bootstrap with Compass?

BTW我也有compass.app,为Foundation和Bootstrap执行一键式安装。我只是发现了一个名为Susy的另一个框架,它看起来很酷。

BTW I also have the compass.app that allows me to do a one-click install for Foundation and Bootstrap. I just found anther framework called Susy and it looks pretty cool too.

谢谢!

推荐答案

任何CSS文件是有效的scss如果你更改扩展名,所以我不会太过分了这些文件之间的差异。你可以很容易地使用Compass与任何框架,并且许多框架已被移植到Compass以更好地集成。

Any CSS file is valid scss if you change the extension, so I wouldn't get too caught up in the differences between those files. You can easily use Compass with any framework, and many frameworks have been ported to Compass for even better integration.

另一方面,我认为Compass改变了什么是框架可以/应该是。 CSS框架难以维护和使用,因为CSS不是构建框架抽象的思想。结果是is肿,非语义的API,尝试做一切,但沿着拐弯处。您可以做得更好。

On the other hand, I think Compass changes the very idea of what a framework can/should be. CSS frameworks are difficult to maintain and use because CSS isn't built with framework abstraction in mind. The result is bloated, non-semantic API's that try to do everything, but cut corners along the way. You can do better.

Compass是为了方便共享更小,集中的插件。 Susy是这些插件之一,还有更多。你会注意到,Susy不像Foundation或Bootstrap:它只有网格,它的方式是不可能没有萨斯。这使得API的可能性有很大的差别。对许多其他插件也是如此。

Compass is built to facilitate the sharing of smaller, focused 'plugins'. Susy is one of those plugins, and there are many more. You'll notice Susy isn't like Foundation or Bootstrap: it only does grids, and it does them in a way that wouldn't be possible without Sass. That makes a large difference in the API possibilities. The same is true with many other plugins.

我使用自己的Compass插件组合来构建一个适合我需要的框架。我建议你也这样做。不要写所有你自己的代码,但找到你最喜欢的插件来滚动自己的框架。 Mine看起来像这样:

I use my own mix of Compass plugins to build a framework custom-suited to my needs. I recommend that you do the same. Don't write all your own code, but do find your favorite plugins to roll your own framework. Mine looks like this:

始终:


  • 罗盘

  • susy

  • 模块化秤

  • 断点

  • compass
  • susy
  • modular scale
  • breakpoint

根据需要:


  • compass-rgbapng

  • animate

  • solarized(不是插件,但容易复制/粘贴)

  • sassy按钮


  • compass-rgbapng
  • animate
  • solarized (not a plugin, but easy to copy/paste)
  • sassy-buttons
  • many many more...

您将获得快速发展的所有优势,但更多的控制力和更好的长期代码。

You get all the benefits of rapid-development, but much more control and better long-term code.

这篇关于使用Compass / Sass与另一个CSS框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆