Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通常更喜欢 Sass 而不是 CSS,一个重要原因是它允许我编写嵌套规则,这通常会减少我编写的代码量。
但是,我想知道这个想法是否有任何缺点。编写嵌套 CSS 代码时会出现什么问题?
你应该只在你需要使用 CSS 时尽可能具体 - 它很容易被带走并最终得到像这样的选择器div#body #content #sidebar ul.results li a,这是 a) 难以阅读,b) 浏览器解释速度较慢,c) 几乎不可能如果需要,可以覆盖。
div#body #content #sidebar ul.results li a
我认为使用 SASS 或 LESS 进行调试会有点困难