Extending selectors from within media queries with Sass

前端 未结 6 1587
别跟我提以往
别跟我提以往 2020-11-29 00:12

I have an item class and a compact \"modifier\" class:

.item { ... }
.item.compact { /* styles to make .item smaller */ }

This is fine. How

6条回答
  •  爱一瞬间的悲伤
    2020-11-29 00:38

    I believe SASS/SCSS does not support the @extend directive inside of a media query. http://designshack.net/articles/css/sass-and-media-queries-what-you-can-and-cant-do/

    You might need to use a mixin instead, though the code bloat needs to be weighed against your objective.

提交回复
热议问题