有时候,你可能为了更好组织CSS或者单纯是为了更好的封装,将一些变量或者混合模块打包起来, 你可以像下面这样在#bundle中定义一些属性集之后可以重复使用:
- #bundle {
- .button () {
- display: block;
- border: 1px solid black;
- background-color: grey;
- &:hover { background-color: white }
- }
- .tab { ... }
- .citation { ... }
- }
你只需要在 #header a中像这样引入 .button:
- #header a {
- color: orange;
- #bundle > .button;
- }
转载本站内容时,请务必注明来自W3xue,违者必究。