Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[译] [030] 原书推荐序 #9

Closed
cssmagic opened this issue Sep 7, 2015 · 1 comment
Closed

[译] [030] 原书推荐序 #9

cssmagic opened this issue Sep 7, 2015 · 1 comment

Comments

@cssmagic
Copy link
Owner

cssmagic commented Sep 7, 2015


本文是早期译版,未经校审。仅供参考。


Foreword

原书推荐序

Ah, the good old days. Back in the previous millennium, we had just two CSS-capable browsers, and what they did was a fairly limited subset of a fairly limited specification, so you could fairly easily keep a complete map of what worked and what didn’t in your head. That map included the bugs in each implementation, as they had many errors and oversights, some of them verging on the comical. Heck, some bugs were so fundamental that they made the browsers’ layout behavior completely incompatible, forcing us to come up with a whole army of parser-bug-exploiting hacks just to work around the differences!

啊,过去的日子多美好啊!回想 2000 年之前,我们只有两款支持 CSS 的浏览器,而且它们所实现的也只是一套非常有限的规范的一个非常有限的子集,因此你可以很容易地在自己的头脑中建立一幅完整的图景,标记出什么好用、什么不好用。这幅图景需要包含各个浏览器实现中的各种 bug,因为这些实现其实存在着不少的错误和疏忽,有些地方甚至错得离谱。唉,有些 bug 还涉及非常基础的层面,以致于各浏览器的布局行为完全不兼容,这迫使我们不得不想出对策,反过来利用浏览器自身的解析器 bug 来变相地纠正这些不一致的行为!

Wait a minute. The old days were horrible. Glad we’re done with all that!

慢着。过去那些日子其实糟透了。所幸它们已经一去不复返了!

Things really have gotten so much better in the last several years, CSS-wise. Browsers have, for the most part, converged on compatibility, and where they are incompatible, it’s nearly always because one browser doesn’t support a feature that another does, as opposed to both of them trying to support the same thing differently, and usually badly. The specifications have pushed capabilities forward even as they’ve added features that recreate the convoluted tricks of old in much simpler, more compact ways. CSS has far more features and far more power than ever before--but, as we all know, with great power comes great complexity. It’s not even a case of intentional complexity: when you combine enough working parts, no matter how simple each may be, interesting things can and do emerge. (For more on this topic, see The LEGO Movie.)

就在最近这几年,CSS 领域已经发生了极大的好转。浏览器(绝大多数)已经在兼容性上逐渐趋同,它们互不兼容的地方几乎都是因为某一家支持了某个特性,而另一家还没支持——这比两家都支持但效果不一样要强多了。规范不仅推动了兼容性的进步,与此同时,规范还增加了新的特性,用简洁得多的新方法取代了以前繁琐的技巧。CSS 拥有了比以多得多的特性、强得多的能力——不过,我们都知道,功能越强大,复杂度也会越高。这甚至已经不是表象上的复杂度问题了:当你把足够多的工作部件组合到一起之后,不管单个部件看起来有多简单,这个组合体一定会产生有趣的结果。(关于这个话题的更多内容,请看《乐高大电影》。)

But it’s exactly that unintended complexity that gives CSS the ability to surprise us with emergent features we never expected, or even planned. There are secrets to be found in the intersections of properties and the bending of values. You can carve corners with gradients, animate elements, increase clickable areas, even create pie charts...and so much more. CSS has capabilities that we only dreamed of back when I was but a lad, possibilities beyond anything we imagined. It’s added abilities that I once thought could never be expressed in a compact, human-readable manner--animations, to pick one example. It’s advanced far enough that I’m confident there are many, many secrets yet to be discovered. Perhaps you’ll discover some of them.

这其实是无意之中产生的复杂度,在不经意之间,CSS 已经获得了种种我们从未期望或设计过的神奇特性。在属性与属性的交错之间、在值与值的混合之下,有很多秘密有待发现。你可以通过渐变图案来挖出凹角、让元素产生动画、扩大可点击区域、甚至创建饼图……不一而足。如今,CSS 已经拥有了我多年前梦寐以求的强大功能,它带来的可能性已经远远超越了我当初的想像。很多我原以为绝不可能以简洁易懂的方式表达出来的功能,现在也已成为 CSS 的一部分——比如动画。CSS 已经进化得如此强大,令我坚信它仍然还有很多很多的秘密有待我们去发现——或许某天你也会有所斩获。

Until that day arrives, there are plenty of fascinating techniques that have already been unearthed, and few have done more than Lea Verou to find and share them with the world. From her blog posts to her open source contributions to her dynamic, interactive talks all over the world, Lea has amassed a formidable reserve of CSS knowledge. This book is a beautiful distillation of that knowledge. You now possess a guide to some of the most interesting, surprising, and useful techniques that CSS has yielded, a guide compiled by one of the brightest minds in the field. What Lea has prepared for you in these pages will enrich, delight, and--yes--even astonish.

眼下,很多炫酷的技巧已经被世人所发挖,但极少有人能像 Lea Verou 那样善于探索、乐于分享。从她的博客文章到她的开源贡献,再到她在全球各地所做的生动演讲,Lea 在 CSS 领域已经建立了令人钦佩的知识储备。而这本书正是这些知识储备的完美升华。你手里的这本书由这个领域内最顶尖的一位智者精心打造,她将带你领略 CSS 所能达成的最有趣、最神奇、最实用的技巧。Lea 在这本书里为你准备的内容将令你充实、愉悦、甚至惊喜。

Go forth, learn well, and let these discoveries be secrets no more.

狂奔吧,成长吧,别再让这些精湛的技艺沦为失传的秘密!

Eric A. Meyer

{--:}——Eric A. Meyer,《CSS 权威指南》作者

@rccoder
Copy link

rccoder commented Oct 27, 2015

风格好赞,有一种读美文,读故事的感觉~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants