My Opinion about so-called "CSS Framework"

There are many so-called "CSS frameworks" in the wild,
some are even open source.

But in general, I don't buy it.


UI sample/guidelines VS codebase/implementation

1) As UI sample/guidelines, of course it's ok for internal usage,
   but it's no value for share (open source).
2) As codebase/implementation, it's bad,
   use "styling class hook" Anti-Pattern.
3) What I mean "bad", not it doesn't work, but it can't scale
   with maintainability, and also have many other faults. Sorry
   I have no time to dive into deep in this short essay, but I
   may have a chance to give a speech in D2 next month and I'd
   like to say something about it.

NOTE: Bootstrap is written in LESS, so it's not traditional "CSS framework"
      though it can be used in such bad way. That's the main reason I don't
      like LESS. Anyway it still be one of the core value of the Bootstrap,
      and the high customizability come from LESS.
      Unfortunately there are some "CSS framework" derived from Bootstrap but
      went backwards by abandon LESS. I feel very sorry about that.


How to refactor those "frameworks" in your team/project

1) Good news: It is possible. Those so-called "CSS frameworks" or any
   real-world stylesheets can be separate into many Stylus mixins and
   modules like reset(if you like css reset)/typo/layout/theme...
   (You also can use SASS/LESS, but I prefer Stylus.)
   Bad new: It need HARD work.
2) As a engineer, I do NOT want to refactor any so-called "CSS framework"!
   It's meanless and inefficient for me. If I need any basic CSS pattern,
   I will choose something like Stylus/Nib (and even contribute code to it),
   or just write it.
3) But from the perspective of a team leader, I will support the
   original author to refactor it, though finally he/she may find
   many parts of it will be easier to build from zero or totally
   rewrite. Other engineers (include me myself) can use it as library
   later because then it's just unobtrusive APIs, and will not
   pollute markups and templates. And it's definitely very helpful
   for the original author and the whole team.


That's all.

你可能感兴趣的:(framework)