Sass允许您将选择器嵌套在选择器中
1 | ul { |
‘&’ 将被父选择器替换.
You can also nest pseudo-classes. 您还可以嵌套伪类
Keep in mind that over-nesting will make your code less maintainable.请记住,过度嵌套会使您的代码难以维护
Best practices recommend going no more than 3 levels deep when nesting.最佳做法建议在嵌套时不要超过3个级别。
例如:
1 | ul { |