Increase font size for mobiles in Foundation 6

五迷三道 提交于 2019-12-11 07:37:15

问题


I'm unable to make the following SCSS increase the font-size on mobiles and tablets:

// Mobile

@include breakpoint(medium down) {
    $global-font-size: 200%;
}

The generated CSS files isn't even changed after adding the code above.


回答1:


Unfortunately it's not possible to define a SASS variable inside a media query. See this Closed issue for a more detailed description (has Foundation as an example).

You can do a similar kind of thing like this though:

%screen-font {
    font-size: 100%;

    @media #{$medium-down} {
        font-size: 200% !important;
    }
}

html {
    @extend %screen-font;
}



回答2:


What I ended up doing is to replace $global-font-size with font-size:

// Mobile

html {
    @include breakpoint(medium down) {
        font-size: 200% !important;
    }
}


来源:https://stackoverflow.com/questions/42591238/increase-font-size-for-mobiles-in-foundation-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!