{"action":"created","issue":{"url":"https://api.github.com/repos/cssmagic/CSS-Secrets/issues/9","labels_url":"https://api.github.com/repos/cssmagic/CSS-Secrets/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/cssmagic/CSS-Secrets/issues/9/comments","events_url":"https://api.github.com/repos/cssmagic/CSS-Secrets/issues/9/events","html_url":"https://github.com/cssmagic/CSS-Secrets/issues/9","id":105211276,"number":9,"title":"[译] [030] 原书推荐序","user":{"login":"cssmagic","id":1231359,"avatar_url":"https://avatars.githubusercontent.com/u/1231359?v=3","gravatar_id":"","url":"https://api.github.com/users/cssmagic","html_url":"https://github.com/cssmagic","followers_url":"https://api.github.com/users/cssmagic/followers","following_url":"https://api.github.com/users/cssmagic/following{/other_user}","gists_url":"https://api.github.com/users/cssmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/cssmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cssmagic/subscriptions","organizations_url":"https://api.github.com/users/cssmagic/orgs","repos_url":"https://api.github.com/users/cssmagic/repos","events_url":"https://api.github.com/users/cssmagic/events{/privacy}","received_events_url":"https://api.github.com/users/cssmagic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cssmagic/CSS-Secrets/labels/%E8%AF%95%E8%AF%BB%E6%A0%B7%E7%AB%A0","name":"试读样章","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-07T12:57:05Z","updated_at":"2015-10-27T07:12:33Z","closed_at":null,"body":"***\r\n\r\n> 本文是早期译版，未经校审。仅供参考。\r\n\r\n***\r\n\r\n# Foreword\r\n# 原书推荐序\r\n\r\nAh, 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!\r\n\r\n啊，过去的日子多美好啊！回想 2000 年之前，我们只有两款支持 CSS 的浏览器，而且它们所实现的也只是一套非常有限的规范的一个非常有限的子集，因此你可以很容易地在自己的头脑中建立一幅完整的图景，标记出什么好用、什么不好用。这幅图景需要包含各个浏览器实现中的各种 bug，因为这些实现其实存在着不少的错误和疏忽，有些地方甚至错得离谱。唉，有些 bug 还涉及非常基础的层面，以致于各浏览器的布局行为完全不兼容，这迫使我们不得不想出对策，反过来利用浏览器自身的解析器 bug 来变相地纠正这些不一致的行为！\r\n\r\nWait a minute. The old days were *horrible*. Glad we’re done with all that!\r\n\r\n慢着。过去那些日子其实**糟透了**。所幸它们已经一去不复返了！\r\n\r\nThings 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_.)\r\n\r\n就在最近这几年，CSS 领域已经发生了极大的好转。浏览器（绝大多数）已经在兼容性上逐渐趋同，它们互不兼容的地方几乎都是因为某一家支持了某个特性，而另一家还没支持——这比两家都支持但效果不一样要强多了。规范不仅推动了兼容性的进步，与此同时，规范还增加了新的特性，用简洁得多的新方法取代了以前繁琐的技巧。CSS 拥有了比以多得多的特性、强得多的能力——不过，我们都知道，功能越强大，复杂度也会越高。这甚至已经不是表象上的复杂度问题了：当你把足够多的工作部件组合到一起之后，不管单个部件看起来有多简单，这个组合体一定会生产有趣的结果。（关于这个话题的更多内容，请看《乐高大电影》。）\r\n\r\nBut 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.\r\n\r\n这其实是无意之中产生的复杂度，在不经意之间，CSS 已经获得了种种我们从未期望或设计过的神奇特性。在属性与属性的交错之间、在值与值的混合之下，有很多秘密有待发现。你可以通过渐变图案来挖出凹角、让元素产生动画、扩大可点击区域、甚至创建饼图……不一而足。如今，CSS 已经拥有了我多年前梦寐以求的强大功能，它带来的可能性已经远远超越了我当初的想像。很多我原以为绝不可能以简洁易懂的方式表达出来的功能，现在也已成为 CSS 的一部分——比如动画。CSS 已经进化得如此强大，令我坚信它仍然还有很多很多的秘密有待我们去发现——或许某天你也会有所斩获。\r\n\r\nUntil 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.\r\n\r\n眼下，很多炫酷的技巧已经被世人所发挖，但极少有人能像 Lea Verou 那样善于探索、乐于分享。从她的博客文章到她的开源贡献，再到她在全球各地所做的生动演讲，Lea 在 CSS 领域已经建立了令人钦佩的知识储备。而这本书正是这些知识储备的完美升华。你手里的这本书由这个领域内最顶尖的一位智者精心打造，她将带你领略 CSS 所能达成的最有趣、最神奇、最实用的技巧。Lea 在这本书里为你准备的内容将令你充实、愉悦、甚至惊喜。\r\n\r\nGo forth, learn well, and let these discoveries be secrets no more.\r\n\r\n狂奔吧，成长吧，别再让这些精湛的技艺沦为失传的秘密！\r\n\r\n{--:}——Eric A. Meyer\r\n\r\n{--:}——Eric A. Meyer，《CSS 权威指南》作者"},"comment":{"url":"https://api.github.com/repos/cssmagic/CSS-Secrets/issues/comments/151398851","html_url":"https://github.com/cssmagic/CSS-Secrets/issues/9#issuecomment-151398851","issue_url":"https://api.github.com/repos/cssmagic/CSS-Secrets/issues/9","id":151398851,"user":{"login":"rccoder","id":7554325,"avatar_url":"https://avatars.githubusercontent.com/u/7554325?v=3","gravatar_id":"","url":"https://api.github.com/users/rccoder","html_url":"https://github.com/rccoder","followers_url":"https://api.github.com/users/rccoder/followers","following_url":"https://api.github.com/users/rccoder/following{/other_user}","gists_url":"https://api.github.com/users/rccoder/gists{/gist_id}","starred_url":"https://api.github.com/users/rccoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rccoder/subscriptions","organizations_url":"https://api.github.com/users/rccoder/orgs","repos_url":"https://api.github.com/users/rccoder/repos","events_url":"https://api.github.com/users/rccoder/events{/privacy}","received_events_url":"https://api.github.com/users/rccoder/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T07:12:33Z","updated_at":"2015-10-27T07:12:33Z","body":"风格好赞，有一种读美文，读故事的感觉~"}}