Reading view

There are new articles available, click to refresh the page.

我终于找到了 safari26 工具栏背景色的识别方法

jaminq:

tahoe 升级以来,safari 去掉了 compact tab 模式的背景,原来 <meta> 的 theme-color 在 macos 上也不再生效。

参考网上没有找到任何有用的信息,不论是 reddit 还是 AI 给的答复都是直接修改 body 的背景色,但是我发线一些网站(例如[ea.com](EA 官网))就完全没有使用 body 的背景色,于是我尝试了下,找到了让 safari 26 识别背景色的最小配置。

html 代码如下

<html>

<head>
    <style>
        div {
            min-height: 6px;
            position: fixed;
            top: 0;
            width: 80%;
        }
    </style>
</head>

<body style="background-color: beige;">
    <div style="background-color: darkgrey;"></div>
</body>

</html>

其中 height 最小 6pxwidth 最小 80%positiontop必不可少,更新于 safari26.0.1 ,后续苹果更新此方法可能失效。

BTW, 关掉在 safari 配置中 tab 的 Show color in tab bar 可以关掉改功能。

❌