行頭に-を入れるだけで取り消し線を入れるUserCSS
TODOを適当に並べてるとき、DONEを表すために打ち消しを使用するのだけど、そのためにわざわざブラケティングしとうない!スマホでもいちいち選択するの大変だし!ということで作った 多分いけてるはず
-YOOOOOOO
Yo-yo
yoyoyo-
-サラマンダーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーアピーーーーーーーーーーーーーーーーーーーーーーーーーーーーール
-打ち消し
-打ち消し
-打ち消し
-打ち消し
-インデントしてるときに、リンクが最初に来てその直後に-を入れた場合にも取り消し線入っちゃいますね
これ修正した
.indent:has(span.char-index[data-char="-"]:first-child):not(:has(span:first-child a))の部分
以下を満たす.indent
最初の文字が-
行頭がリンクで始まらない
カーソルが乗ってるときは取り消し線が入らないようにした
行頭がブラケティングされたSpaceで始まる際は取り消し線が入らないようにした
.indent:has(span.char-index[data-char="-"]:first-child):not(:has(span:first-child a)):not(:has(span:first-child span.blank))
-ああああああああ
-「-」だけが入力された行がdisplay:noneによってheight 0になってしまう
テスト↓
-
min-heightを設定することで解決
-強調されてるときは見た目が崩れる
code:strikethrough without bracketing.css
.line:not(.cursor-line) {
.indent:has(span.char-indexdata-char="-":first-child):not(:has(span:first-child a)):not(:has(span:first-child span.blank)){ text-decoration:line-through;
min-height: 28px; /*.editorのデフォルトのline-height*/
}
.indent:not(:has(span:first-child a)):not(:has(span:first-child span.blank)) span.char-indexdata-char="-":first-child{ display:none
}
}