使用背景过滤器时无法删除滚动上的模糊边缘:模糊

Ale*_*ris 5 css scroll blur blurry filter

当尝试 glassmorphism 样式并使用 css 背景过滤器时,滚动时我会在元素顶部看到深色模糊边缘。我觉得这应该是一个简单的修复,但我已经尝试了我所知道的一切(这显然是不够的)并且无法弄清楚。我创建了一支笔,这样你就可以看到我在说什么。由于某些令人困惑的原因,您必须在 codepen 中打开它才能看到不良效果。

body {
  background-image: url("https://www.theuiaa.org/wp-content/uploads/2017/12/2018_banner.jpg");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  height: 200vh;
  background-color: rgba(255, 255, 255, 0.5);
  background-blend-mode: soft-light;
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50%;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  width: 320px;
  height: 540px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
}

.arrow {
  position: sticky;
  top: 0px;
  font-size: 200px;
  line-height: 1;
  color: red;
}

.card p {
  font-size: 32px;
  padding: 20px;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
<div class="card">
  <div class="arrow"><span>&#129041;</span></div>
<p>As you can see when you scroll down, as soon as the card hits the top of the screen, you get a blurred edge. Not cool...</p>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

代码笔

Lou*_*tte 1

我认为您发现了 Chrome 问题!(在 Firefox 中不会发生这种情况)

我很快检查了chromium bug,但没有发现任何接近的东西..所以我建议你报告它!

另外,我做了一个测试来确定黑色“渐变”来自哪里......我改变了backgroundCodepen 的颜色.main-header

要重现,请将其粘贴到控制台中:

document.querySelector(".main-header").style.background = "red"
Run Code Online (Sandbox Code Playgroud)

预期结果是:

检查器中的 CodePen 主标题

但令人惊讶的是“渐变”现在变成了红色
您当然知道 codepen 结果是iframe......所以我认为这称为“绘画”问题。

CoderPen 主标题结果