You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It took me a whole afternoon to find this out....😂
And I made a minimum repro about this.
在写自定义主题的时候,发现我自己写的导航栏的
backdrop-blur
怎么也不起作用,永远是全透明的状态。一开始以为是 Tailwind CSS / UnoCSS 的问题,
但是把我的代码放到 Tailwind / UnoCSS 的 Playground 里面,都能正常显示。
然后怀疑问题出在 VitePress 上,一番 debug 后发现,把我
index.md
里面的内容 inline到
Layout.vue
里面(替换掉<Content />
)就能正常显示,但是<Content />
就是不行。然后来这个仓库翻了源代码,发现这个 commit 给
<Content />
默认加了position: relative;
。。因为我是前端新手,所以想了半天也没想明白这个东西和
backdrop-blur
怎么产生关系的,最后查了 MDN
才知道(想起来),原来
position: relative;
会让原本的对象跑到“上面”。。。所以需要手动给 navbar 的 CSS 属性加上至少是 1 的
z-index
。感觉自己还是太 naive 了,还需要多学习一个。
Beta Was this translation helpful? Give feedback.
All reactions