分类和标签面包屑导航下拉菜单定位问题

您好!我正在尝试创建一个自定义主题,所以我 fork 了“air theme”并进行了一些修改,但我注意到类别和标签的下拉菜单定位方式很奇怪。

您知道可能是什么原因造成的吗?我没有更改主题中任何与 JS 相关的内容,只修改了 CSS。您可以在此处查看我的代码:GitHub - Decryptu/discourse-decrypt: A modern theme with a dark mode option.

这一定是我的主题问题,因为当我选择默认的“air theme”时,下拉菜单就定位在正确的位置。我也没改过“transform”或“inset”属性。

希望有人能帮帮我,谢谢!

1 个赞

这是一个有点出乎意料的情况,但似乎定位受到以下 CSS 的影响:

html body #main-outlet {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

删除这些行可以为我解决问题。

Apparently backdrop-filter creates a new block context in CSS, some more info here… https://stackoverflow.com/a/52937920/1869753

This means that your position:fixed element will be positioned relatively to the filtered container and no more the viewport. In other words, it’s still fixed but inside its new containing block (the filtered container)

6 个赞

哦,太棒了,感谢您的发现,我从未想过要删除它,我会删除它们并尝试寻找背景模糊的替代方法,非常感谢您。

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.