Settings最適化計画 2025/03/22
主に最適化するところ
計算量
バンドルサイズ
今回は、主に計算量の最適化を優先する
やり方
:hasの左側を詳細化する
直下セレクタを活用する
多少の記述の冗長化は許容する
曖昧なセレクタをできるだけ詳細化する
これによりDOM探索範囲が減る
仕様変更に弱くなるというデメリットがある
使用率が低いCSSを無効化
一旦、minifyなしでbundleして:hasの使用状況を調べる
.line .text > span:has(a.link.icon:is([href$="/icons/hr"], [href$="/icons/hrd"]))
.line .text > span span:has(a.link.icon:is([href$="/icons/hr"], [href$="/icons/hrd"]))
span:has(> span.deco-\+.deco-_)
このCSSあまり使われてないので消すか
.line:not(.cursor-line) .deco:has(.deco-\'):has(.deco-_)
&:has(.deco--)
:has(.deco-_)
.line:not(.cursor-line) .deco-\#:not(:hover):not(:has(a))
.line:not(.cursor-line) .deco-\#:not(:hover):has(img)
.line:not(.cursor-line) .deco-\#:not(.deco-\#.deco-\+):has(a:not(.icon))
.line:not(.cursor-line) [class="deco-( deco-)"]:not(:has(img.icon))
.line:not(.cursor-line) [class="deco-( deco-)"]:not(:has(img.icon)) a
.line:not(.cursor-line) .deco-\+.deco-\#
&:not(.hover):has(img)
削除
.stream .page:is([data-title="\3082\307a\3082\307a\7e3a\ff6e\8373\ff78\7e3a?\ff44\7e3a\ff64"]) .line a:has(img)
ul.dropdown-menu > li.dropdown-item:has(a:focus)
.line .quote:has(.indent-mark)
消しても良さそう
Settings 21881 bytes