媒体查询中不会覆盖变量

时间:2014-05-22 22:38:29

标签: sass

我需要在媒体查询下更改少量变量的值。对不行,不行。可能吗?

$origami-width:             565px;
$origami-height:            332px;
    @media (max-width: $screen-sm-max){
    $origami-width:             370px;
    $origami-height:            300px;
}

1 个答案:

答案 0 :(得分:0)

我让它像这样工作。谢谢!

 @media (min-width: $screen-md){
    $origami-width:             565px;
    $origami-height:            332px;

    .origami-container {
        width: $origami-width * 2;
    }
    .origami {
        @include size($origami-width, $origami-height);

        .content {
            height: $origami-height;
        }
    }
 }

 @media (max-width: $screen-sm-max){
    $origami-width:             370px;
    $origami-height:            300px;

    .origami-container {
        width: $origami-width * 2;
    }
    .origami {
        @include size($origami-width, $origami-height);

        .content {
            height: $origami-height;
        }
    }
}