所有这些 CSS 框架和其他框架怎么了?

发布于 2024-10-26 02:30:56 字数 1436 浏览 16 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

伴随着你 2024-11-02 02:30:56

LESS 和 SASS 是服务器端 CSS 生成框架——它们允许您使用接近 CSS 的语法创建样式表,但允许您使用变量和函数等项目。编译这些文件将生成您使用的 CSS 文件。这里需要注意的重要一点是 SASS 仅适用于 Ruby。

HAML 是另一个仅适用于 Ruby,但不支持 CSS 的项目。它实际上是创建 ERB(Ruby 部分视图)的替代方法。

Compass 是一个添加在 SASS 框架之上的库,允许更多的功能和一些默认的类/样式。

Blueprint 是另一个库,它基本上是一个带有预设类的 CSS 文件,允许创建多列布局等常见用例。

然而,这些都不是编写 CSS 所必需的,而且在大多数情况下,还不够好,无法真正研究。虽然我喜欢 SASS 的功能,但它并不适合所有人,并且最终会创建不必要的臃肿 CSS。

如果您刚刚开始尝试 CSS,我会推荐 Andy Clarke 的 Transcending CSS 和 Hardboiled Web Design 等资源。 HTML5 for Web Designers 和 CSS3 for Web Designers 也是非常好的资源。充分理解 HTML 标记和语义对于充分利用 CSS 并正确使用它也很重要。

LESS and SASS are server-side CSS generation frameworks -- they allow you to create stylesheets using syntax that is close to CSS, but allows you to use items like variables and functions. Compiling these files will then generate a CSS file that you use. An important thing to note here is that SASS is only available for Ruby.

HAML is another item that is only available for Ruby, but doesn't do CSS. It's actually an alternate to creating ERBs (a Ruby partial view).

Compass is a library that is added on top of the SASS framework, allowing a bit more functionality and several default classes / styles.

Blueprint is another library that is basically a CSS file with preset classes, allowing for common use-cases like creating multi-column layouts.

However, none of these are needed to write CSS, and for the most part, aren't even good enough to really look into yet. While I love the functionality of SASS, it's really not for everyone, and ends up creating more bloated CSS than necessary.

If you're just starting to experiment with CSS, I would recommend resources like Transcending CSS and Hardboiled Web Design by Andy Clarke. HTML5 for Web Designers and CSS3 for Web Designers are also both pretty good resources. A good understanding of HTML markup and semantics are also important for taking advantage of CSS and using it correctly.

岁吢 2024-11-02 02:30:56

HAMLSASS 是相辅相成的,HAML 是一种编写 HTML 的快捷语言,SASS(或 SCSS) 是一种用于编写 CSS 的快捷语言 您必须知道如何“手写”编写 HTML/CSS,以便充分利用 HAML/SASS 快捷方式版本。

这些快捷方式只能在 DEV 中使用,除非你有一个 RUBY 服务器 - 当我看到上述两种语言都是“哑”语言的“替代品”时,我真的很恼火。特别是你需要搜索的是说“CSS is Dumb”来查找 SASS/SCSS 的引用 - 这是一种恶意的链接诱饵策略;)你不能在不知道另一个的情况下使用一个

COMPASS 是一个 Ruby Gem,有助于编译 HAML 和 SASS /SCSS(到 HTML 和 CSS)在本地环境中 - 在开发环境中,这意味着通过这些语言所做的更改将被编译为适当服务器上的“正确”HTML 和 CSS 服务器端

LESS 是相当于 SASS 的 JavaScript。您可以在服务器端(通过 Node.js)或客户端(通过导入 js 文件)使用它,它会采用您编写的快捷方式并将其编译为有效的 CSS(具有多浏览器或供应商扩展)

BLUEPRINT 是一个可以与纯 CSS 或快捷方式一起使用的框架(免责声明:我不喜欢框架,因为它们添加了不必要的类)如果您想在 Compass/SaSS/LESS 中使用 Blueprint 或 Yahoo Grids Framework,那么您在指责那些试图使它们的实现更容易的工具之前,最好先了解它们在做什么 - 这些工具不会使这些框架工作,但是如果您真的想使用它们,它们将使您必须做的打字量减少他们。

我最近尝试了 LESS/SaSS 和 SCSS ..我喜欢它们,但后来我知道如何编写 CSS 首先,我不希望它们做更多的事情而不仅仅是成为一个让我的生活更轻松的工具..他们不CSS 已经比 CSS 做得更好了,但是它们可以嵌套和组织 CSS,我真的很喜欢!

HAML and SASS go together, HAML is a shortcut language for writing HTML, SASS (or SCSS) is a shortcut language for writing CSS you have to know how to write both HTML/CSS "longhand" in order to get the best out of the HAML/SASS shortcut versions.

The shortcuts should only be used in DEV, unless you have a RUBY server - I get really annoyed when I see that both of the above languages are a "replacement" for "dumb" languages.. In particular all you have to search for is that "CSS is Dumb" to find references to SASS/SCSS - it's a vicious linkbait ploy ;) you cannot use one without knowing the other

COMPASS is a Ruby Gem that aids in the compilation of HAML and SASS/SCSS (to HTML and CSS) in a local environment - in a development environment it means that changes made via those languages will be compiled to "proper" HTML and CSS serverside on an appropriate server

LESS is a javascript equivalent of SASS. You can use it on the server-side (via node.js) or clientside(by just importing a js file) it takes the short cuts you write and compiles it into valid CSS (with multi browser or vendor extensions)

BLUEPRINT is a Framework that can be used with plain CSS or shortcut (disclaimer: I don't like frameworks as they add unnecessary classes) If you want to use the Blueprint or Yahoo Grids Framework within Compass/SaSS/LESS then you'd better understand what they're doing first before blaming the tools which try to make their implementation easier - These tools do not make these Frameworks work, they will however make the amount of typing you have to do decrease if you really want to use them.

I recently tried LESS/SaSS and SCSS.. I like them but then I know how to write the CSS in the first place I don't want them to do more than become a tool to make my life easier.. they don't "do" CSS better than CSS can do already, they can however do nesting and organization of your CSS, which I really like!

怼怹恏 2024-11-02 02:30:56

您确实不应该出于任何原因使用任何这些“语言”或“工具”。它们将自己呈现为多浏览器或参数化 css 生成器的快捷方式,这是一个好主意,但最终这些东西可以使用普通的旧 CSS 以许多其他方式非常优雅地实现。

它们不应该取代使用普通的旧 CSS,并且它们可能产生的膨胀在许多情况下阻止了这种可能性。

不使用这些东西的一个非常令人信服的理由是,它显着提高了加入项目的任何开发人员的安装要求,或者想要从一台机器转移到另一台机器的开发人员,或者需要他们的机器同质化以便做出贡献的开发团队。例如,需要安装ruby,或者各种python版本,或者php存根来根据时间戳动态编译css等等,都将像SASS这样想要让事情变得更简单的工具变成了一个可能非常复杂的东西。

随着 CSS3 的承诺,这些工具希望促进的许多事情将变得过时。

You really shouldn't use any of these 'languages' or 'tools' for any reason. They present themselves as shortcuts for multi-browser or parameterized css generators, which is a nice idea, but in the end these things can be achieved many other ways very elegantly using plain old CSS.

They should not be a replacement for using plain old CSS, and the bloat that they can generate prevents that possibility in many cases.

A very compelling reason to NOT use these things is that it raises the install requirements significantly for any developer joining a project, or a developer wanting to move from one machine to another, or a team of developers needing their machines to homogenize in order to contribute. For instance, requiring the installation of ruby, or various python versions, or php stubs to dynamically compile css based on timestamps, etc., all change a tool like SASS, which wants to make things simpler, into a potentially very complicated thing.

With the promise of CSS3, a lot of the things these tools hope to facilitate will become obsolete.

暖树树初阳… 2024-11-02 02:30:56

长期以来,使用 SASS + Compass + Suzy 一直是我的 Web 开发工作流程中最大的新鲜空气。使用这些工具设计漂亮的流体/弹性/固定自定义网格布局的速度非常快。我只希望我能早点知道他们。

据我所知,CleverCSS 是一个与 SASS 几乎相同的 Python 程序,尽管您不能使用 CleverCSS 进行 @import 操作。另外,SASS 在每个 CSS 选择器之后没有分号,只有 CSS 属性,而 CleverCSS 在两者之前都有分号(在我看来,这使得它在语法上更差一些)。

这篇文章非常适合您查看Django / Python 人。如果您决定使用 SASS 而不是 CleverCSS 或其他,您不会感到肮脏。只需接受它并安装 Ruby 并设置 SASS / Compass 来监视文件夹并在保存 .sass 文件时自动生成 CSS。如果您想保存更改,请不要弄乱生成的 CSS 文件。不需要与您的其他全 Python 设置进行进一步的“集成”。

Using SASS + Compass + Suzy has been the biggest breath of fresh air for my web development workflow in a long time. Styling a beautiful fluid / elastic / fixed custom grid layout with these tools is incredibly fast. I only wish I knew about them sooner.

CleverCSS is a Python program that is nearly identical to SASS from what I can tell, although you can't do @import with CleverCSS. Also SASS doesn't have a semicolon after each CSS selector, just CSS properties, while CleverCSS has semicolons before both (which makes it a little more syntactically inferior IMO).

This article is good to check out if you're a Django / Python person. You won't feel dirty if you decide to use SASS rather than CleverCSS or others. Just suck it up and install Ruby and setup SASS / Compass to watch a folder and autogenerate your CSS on saving .sass files. Just don't mess with the generated CSS files if you want to save your changes. No further "integration" with your otherwise all-Python setup is needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文