settings/favicon
#Internal / #settings #CSS
Date: #2024-08-06
概要
特定のドメインに favicon を付ける CSS
favicon の取得には Google の隠し API を使っている
アイコンコンテナの設定 と アイコン画像 の両方に記述を追加すること
できればアルファベット順で追記すること
アイコンコンテナの設定
code:style.css
a.link[href^="https://github.com"]::before,
a.link[href^="https://metacpan.org/pod"]::before {
display: inline-block;
vertical-align: middle;
margin-right: 0.25rem;
}
アイコン画像の設定
code:style.css
/* GitHub */
a.link[href^="https://github.com"]::before {
content: url('https://www.google.com/s2/favicons?domain=github.com&sz=16');
}
/* meta::cpan */
a.link[href^="https://metacpan.org/pod"]::before {
content: url('https://www.google.com/s2/favicons?domain=metacpan.org&sz=16');
}