来自Goofus和Gallant的CSS智慧

Avatar of Chris Coyier
Chris Coyier

DigitalOcean 为您旅程的每个阶段提供云产品。 立即开始使用 200美元免费信用额度!

我找到了一些旧的Highlights杂志,这些Goofus和Gallant的角色确实有一些先见之明的智慧可以分享。

Goofus sneezes his overly specific selectors and !important rules all over the codebase. Gallant carefully follows the low specificity naming conventions of the project and cleans up after his messes.

Goofus blasts his opinions around like fact and makes open conversation difficult. Gallant helps lead discussions with his peers about the possibilities, advantages, and disadvantages of different choices.
Goofus needs a higher z-index value for his widget so he selfishly makes it 9999999999. Gallant makes a reduced test case of has problem and shows his co-workers.
Goofus “fixes” the design bug by adding an inline style. Gallant figures out where the design pattern went wrong so he can address the root cause.