ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
最后,如果有一件事是我想从整个样式指南中传授的,那就是:**Sass 以简为美,简约至上**。 感谢我过去使用 Sass 时傻傻的尝试,比如 [bitwise operators](https://github.com/HugoGiraudel/SassyBitwise)、[iterators and generators](https://github.com/HugoGiraudel/SassyIteratorsGenerators) 和 [a JSON parser](https://github.com/HugoGiraudel/SassyJSON),从而认识到了可以用预处理器来做什么。 同时,CSS 是一门简单的语言,那么 Sass 在书写常规 CSS 的时候就不应该更复杂。[KISS principle](http://en.wikipedia.org/wiki/KISS_principle) (Keep It Simple Stupid) 在这里是一个核心原则,甚至在有些情况下要优先于[DRY principle](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself) (Don’t Repeat Yourself)。 有时候,一点点重复可以更好的保持代码的可维护性,而不是建立一个头重脚轻、臃肿复杂、不可维护的系统。 此外,请允许我再一次引用 [Harry Roberts](https://csswizardry.com/) 的观点,**实用胜过完美**。有些时候,你可能会发现自己违背了这里所描述的规则。如果感觉自己的方式有道理,感觉很正确,那就继续做吧。编写代码从来都不是一家之言。 ## 扩展阅读 * [KISS principle](http://en.wikipedia.org/wiki/KISS_principle) * [DRY principle](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself) * [Keep Sass Simple](http://www.sitepoint.com/keep-sass-simple/)