Breakpoint Sass: Or Queries for Multiple Breakpoints

醉酒当歌 提交于 2019-12-05 15:59:50

You should pass one parameter (a list), instead of two.

Try this.

@include breakpoint(($breakpoint-medium, $breakpoint-large)) {
    .mobile-navigation{display: none;}
}

I've wrapped your comma separated variables with parentheses. Now Sass will see them as a one list, instead of two parameters.

There are no OR queries in compass breakpoints, in particular @include breakpoint(($breakpoint-medium, $breakpoint-large)) fails with:

WARNING: Responsive contexts are not available for or queries as which query to use is ambiguous. Please only use single context queries. Default context is used.

You can use OR queries with the plain css @media rules if you really need it.

The right solution is to not specify a max width for your breakpoints, only the min width. Then start writing your sites without breakpoints ("mobile first"). If layout needs to change at a certain width you @include breakpoint($brk) and change the layout for all widths larger than $brk. That way you never have to specify a list of intervals that the media query applies to.

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