hr.iconをCSSで描画するUserCSS
from /per-terra/hr.iconをCSSで描画する
#2024/02/22 23:01:45 可変幅バージョンに変更per_terra.icon
#2024/02/23 00:17:31 無意味なネストを削除
パフォーマンス上の問題がありそうだったので
#2024/02/23 11:20:47 固定幅に戻してみる
Gyazzみたいなエディタ作りでReact.jsを学ぶ: TypeScript/Deno化#65d80167ffff360000b8d291
#2024/02/23 11:43:07 なんか大丈夫そうなので可変幅に戻す
井戸端だと/icons/hrか/icons/-が使われている
/icons/hrの方が人気っぽい
固定幅バージョン
code:style.disable.css
.line a.link.icon:is(
href$="/icons/-", /* */
/* href$="/icons/---", /* */
href$="/icons/hr", /* */
/* href$="/icons/%E6%B0%B4%E5%B9%B3%E7%B7%9A", /* /icons/水平線.icon */
href$="/icons/hrd" /* */
) {
img, span { display: none; } /* spanはiconが読み込まれるまでの間に表示される */
&::before {
display: inline-block;
width: 100%;
vertical-align: middle;
content: "";
border-top: 1px solid #afafaf;
}
}
.line a.link.icon:is(href$="/icons/hrd")::before {
border-style: dashed none none;
}
可変幅バージョン(多分重い)
code:style.css
.lines>.line>.text>span:has(>span>a.link.icon:is(
/* href$="/icons/-", /* */
/* href$="/icons/---", /* */
href$="/icons/hr", /* */
/* href$="/icons/%E6%B0%B4%E5%B9%B3%E7%B7%9A", /* /icons/水平線.icon */
href$="/icons/hrd" /* */
)) {
display: flex;
flex-wrap: wrap;
}
.lines>.line>.text>span>span:has(>a.link.icon:is(
/* href$="/icons/-", /* */
/* href$="/icons/---", /* */
href$="/icons/hr", /* */
/* href$="/icons/%E6%B0%B4%E5%B9%B3%E7%B7%9A", /* /icons/水平線.icon */
href$="/icons/hrd" /* */
)) { flex-grow: 1 }
.line a.link.icon:is(
/* href$="/icons/-", /* */
/* href$="/icons/---", /* */
href$="/icons/hr", /* */
/* href$="/icons/%E6%B0%B4%E5%B9%B3%E7%B7%9A", /* /icons/水平線.icon */
href$="/icons/hrd" /* */
) {
width: 100%;
img, span { display: none; } /* spanはiconが読み込まれるまでの間に表示される */
&::before {
display: inline-block;
width: 100%;
vertical-align: middle;
content: "";
border-top: 1px solid #afafaf;
}
&:is(href$="/icons/hrd")::before {
border-style: dashed none none;
}
}
↓これ
あああ/icons/hr.iconあああ
あああ/icons/hrd.iconあああ
hr.icon
最近使えるようになったネスト記法だ!takker.icon
settings.icon
UserCSS.icon