how can I write a scss use vw unit in mobile and use px in pc

Viewed 26

I try something like this, but not working.

@media (min-width:750px) {
    @function pxvw($val){
        @return $val * 1px;
    }
}
@media (max-width:750px) {
    @function pxvw($val){
        @return $val * 1vw;
    }
}
.block{
    height: pxvw(30);
    width: pxvw(30);
}

Is there any solution to make this work?

0 Answers
Related