且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

反对使用CSS框架的论点是什么?

更新时间:2022-03-10 04:31:36

主要的论点是CSS不是真正的编程语言。框架意在包括可重用的函数和数据结构。 CSS没有这些结构。 CSS框架更类似于字处理器中的模板。

The main argument is that CSS is not really a programming language. A framework is meant to include reusable functions and data structures. CSS has neither of these constructs. A CSS "framework" is more akin to a template in a word processor. It provides ready-done design work, but it also imposes more constraints than starting from a blank slate.

顺便说一下,这是推动指南针。它类似于CSS框架,但它使用CSS元素语言 Sass ,它有函数和变量。因此,而不是(例如)将列烧录到框架中,您可以写入 + columns(5)+ column-margin(1em) CSS。

Incidentally, this was what drove the development of Compass. It's similar to a CSS framework, but instead it uses the CSS metalanguage Sass, which does have functions and variables. Thus rather than (for example) having columns baked into the framework, you can write something like +columns(5) +column-margins(1em) and it will generate the appropriate CSS.