V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jaminq

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

  •  
  •   jaminq · Oct 10, 2025 · 1006 views
    This topic created in 209 days ago, the information mentioned may be changed or developed.

    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 可以关掉改功能。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5249 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 09:43 · PVG 17:43 · LAX 02:43 · JFK 05:43
    ♥ Do have faith in what you're doing.