触摸栏上的自定义Safari书签图标和颜色 [英] Custom Safari bookmark icon and color on Touch Bar
问题描述
触摸栏上的书签示例:
我已经在一周后找到了我的问题的答案,希望这可以帮助别人。
首先,您需要创建一个特殊的徽标矢量图并上传到您的网站,矢量图必须是100%黑色,透明背景,然后您需要添加一个蒙版图标元标签到您的网站。你可以设置这个HTML标签中的图片颜色。此图片用于触摸栏和固定选项卡。
掩码图标HTML标记:
< link rel =mask-iconhref =website_icon.svgcolor =#121212>
查看Apple开发人员文档:
https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent /pinnedTabs/pinnedTabs.html
The Macbook Pro 13 and 15" laptops have a Touch Bar (interactive display) on the keyboard. All the bookmarks are displayed on the Touch Bar when using Safari. Some websites (like Facebook) show a custom icon with a custom background color on the Touch Bar. How do I do this as a web developer?
Do I need to use a special Favicon, or use special HTML meta-tags (like og:image) in a specific image format?
Bookmarks example on the Touch Bar:
I have found the answer to my question after a week. Hope this helps someone.
First, you need to create and upload a special vector image of your logo to your website. The vector image needs to be 100% black with a transparent background. Then you need to add a "mask-icon" metatag to your website. You can set a color for your image in this HTML tag. This image is used for the touch bar and also for pinned tabs.
The mask-icon HTML tag:
<link rel="mask-icon" href="website_icon.svg" color="#121212">
Check out the Apple developer docs: https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/pinnedTabs/pinnedTabs.html
这篇关于触摸栏上的自定义Safari书签图标和颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!