特定のリンクにアイコンをつけるUserCSS
これは現在使用していないMijinko_SD.icon
移行先:リンクにアイコンを付けるCSSを生成するスクリプト
元ソース:/villagepump/特定のリンクにアイコンをつけるUserCSS
Scrapboxの外部サイトリンク記法の頭に、リンク先に対応したアイコンをつけるUserCSS
サンプル
PDF
GitHub
Twitter
注意
Font Awesomeを常時使えるようにするUserCSSも併用する必要がある
ソースコード
外部リンクを区別するUserCSSを無効にするCSS
アイコンをつけるリンクに限り無効化する
code:style.css
div.line span:not(.modal-image):not(.pointing-device-map) > a.link:not(.icon):is(
href$=".pdf",
[href^="https://twitter.com"],
[href^="https://github.com"],
[href^="https://raw.githubusercontent.com"],
[href^="https://gist.github.com"],
)::after {
display: none;
}
標準機能のTwitterアイコンを非表示にする
code:style.css
i.fa-twitter::before {
content: none;
}
.line .link .favicon.fa-twitter {
margin: 0;
}
共通設定
code:style.css
.line span > a.link:is(
href$=".pdf",
[href^="https://github.com"],
[href^="https://raw.githubusercontent.com"],
[href^="https://gist.github.com"],
[href^="https://twitter.com"],
[href^="https://pbs.twimg.com"],
[href^="https://video.twimg.com"],
)::before {
display: inline-block;
width: 1em;
height: 1em;
line-height: 1em;
vertical-align: middle;
text-align: center;
background-size: contain;
background-repeat: no-repeat;
/* color: #888; */
}
個別設定
PDF
code:style.css
.line a.link:not(.icon)href$=".pdf"::before {
content: '\f1c1';
font-weight: 400; /* use Regular Style */
margin-right: 1px;
}
GitHub
code:style.css
:is(.line, .line .deco) a.link:is(
[href^="https://github.com"],
[href^="https://raw.githubusercontent.com"],
[href^="https://gist.github.com"],
)::before {
content: '\f09b';
font-weight: 400;
margin-right: 1px;
}
Twitter
code:style.css
:is(.line, .line .deco) a.link:is(
[href^="https://twitter.com"],
[href^="https://pbs.twimg.com"],
[href^="https://video.twimg.com"],
)::before {
content: '\f099';
font-weight: 400;
margin-right: 1px;
}