SASS 左边的尾随加号是否有意义

Does a trailing plus sign on the left make sense in SASS

我在 SASS 中遇到了一段类似于

的代码
.foo {
    + .someClass {
        padding: 1rem;
    }
}

加号显然有相邻组合符的作用。不应该写成& + .someClass吗?如果运算符左侧为空,是否仍然有效?它是 select .someClass.foo 相邻还是其他什么意思?如果 & 是有效的,那么省略它是一个好习惯吗?

虽然有效,但在 combinators is not necessary at all. The ampersand is only needed for attribute selectors, pseudo classes, and pseudo elements, because the real difference between those using & and those not (in theory) is the space in the output. Here's 之前添加了一个符号 combinators is not necessary at all. The ampersand is only needed for attribute selectors, pseudo classes, and pseudo elements, because the real difference between those using & and those not (in theory) is the space in the output. Here's 这是一篇很好的文章。