1

我正在开发 Woocommerce Storefront 的儿童主题。

在平板电脑(纵向,768px 宽)上,我希望显示“移动”布局(汉堡菜单等),而不是桌面布局(主菜单等)。

我在我的 css 文件中使用了以下 css 媒体查询: @media (max-width: 768px)for mobile @media (min-width: 769px)for desktop。

但是店面的所有媒体查询似乎都激活了桌面布局@media (min-width: 768px)

如何更改此断点?

编辑 1:我尝试将文件 wp-content/themes/storefront/assets/sass/utils/_variables.scss 编辑为

$desktop:           769px;
$handheld:          768px;

但它不会改变布局。

编辑2:我在functions.php中试过这个

// Change Woocommerce css breaktpoint from max width: 768px to 767px  
add_filter('woocommerce_style_smallscreen_breakpoint','woo_custom_breakpoint');
function woo_custom_breakpoint($px) {
  $px = '769px';
  return $px;
}

但它也不起作用。

4

1 回答 1

-1

我更改了 /storefront/assets/sass/utils/_variables.scss 中的断点值,并使用店面中的 grunt 文件重新编译所有店面文件(包括 sass 文件)。跑吧$ grunt

于 2017-10-18T17:35:01.947 回答