箇条書きのバレットをFontAwesomeにするUserCSS
番号なしリスト
アイコン指定
code:style.css
.line .indent-mark .dot::before {
display: block;
/* position: inherit; */
/* top: -12px; */
position: absolute;
/* right: -5px; */
top: -10px;
code:style.css
/* font-family: FontAwesome; /* old */
font-family: 'Font Awesome 5 Free';
font-size: 6px;
content: '\f068';
font-weight: 900;
}
既定のbulletを消す
code:style.css
.line .indent-mark .dot {
background-color: transparent;
}
フォントサイズ
widthを指定しているselectorはStreamだとindent情報が消える対策
code:style.css
.line .indent-mark .c-0 + .dot::before {
font-size: 10px;
}
.line .indent-mark .c-1 + .dot::before {
font-size: 9px;
}
.line .indent-mark .c-2 + .dot::before {
font-size: 8px;
}
.line .indent-mark .c-3 + .dot::before {
font-size: 7px;
}
色
:nth-child()を使って無限に繰り返すようにした
最初は:nth-child(6n+1)ではなく:nth-child(6n+2)を指定する
.c-0のあとに.dotが来る
https://gyazo.com/48b70874e033fa18eda070a107a47cdf
インデントレベル1のdotはspan.indent-markの2番目の子要素なので6n+2にマッチ
code:style.css
.indent-mark .dot:nth-child(6n+2)::before {
}
.indent-mark .dot:nth-child(6n+3)::before {
}
.indent-mark .dot:nth-child(6n+4)::before {
}
.indent-mark .dot:nth-child(6n+5)::before {
}
.indent-mark .dot:nth-child(6n+6)::before {
}
.indent-mark .dot:nth-child(6n+7)::before {
}
番号つきリスト
code:style.css
.line.number-list .dot {
display: list-item; /* 表示する */
}
アイコン指定
code:style.css
.line.number-list .dot::before {
position: inherit;
top: -11px;
content: '\f292'; /* #:通常 */ /* content: '\f2dc'; /* 雪:クリスマス用 */
font-size: 4px;
}
フォントサイズ
code:style.css
.line.number-list .c-0 + .dot::before {
font-size: 8px;
}
.line.number-list .c-1 + .dot::before {
font-size: 7px;
}
.line.number-list .c-2 + .dot::before {
font-size: 6px;
}
.line.number-list .c-3 + .dot::before {
font-size: 5px;
}
.line.number-list .c-4 + .dot::before {
font-size: 4px;
}