作者:零开始1023_511 | 来源:互联网 | 2023-05-19 01:07
IhavesomeSasslikethis:我有一些这样的蠢货:.zbounce1,.zbounce2,.zbounce3,.zbounce4animation-nam
I have some Sass like this:
我有一些这样的蠢货:
.zbounce1, .zbounce2, .zbounce3, .zbounce4
animation-name: bounceIn
animation-duration: .5s
animation-timing-function: ease-in-out
span.zbounce1, span.zbounce2, span.zbounce3, span.zbounce4
display: inline-block
I would like to simplyfy the second part to a nested bit of the first part, so I don't have to mention every class again:
我想把第二部分简化为第一部分的嵌套部分,这样我就不用再提每一个类了:
span.&
display: inline-block
Sadly, this is not legal. (The other way round, specializing a bunch of styles with a nested &.anotherClass
is easy...
可悲的是,这是不合法的。(反过来说,用嵌套&专门化一组样式。anotherClass很容易…
Any workaround to achieve this? (perhaps with the @extendOnly-Placeholder?) or some funky sass concatenation...?
有什么解决办法吗?(也许是@extendOnly-Placeholder?)或者一些时髦的sass连接……?
2 个解决方案