/* 自定义 emoji 数字 counter-style */
@counter-style emoji-numbers {
system: numeric;
symbols: "0️⃣" "1️⃣" "2️⃣" "3️⃣" "4️⃣" "5️⃣" "6️⃣" "7️⃣" "8️⃣" "9️⃣";
suffix: "";
}
/* 初始化顶层计数器 */
.protyle-wysiwyg {
counter-reset: h1;
}
/* h1 设置并重置 h2 */
.protyle-wysiwyg .h1 {
counter-reset: h2;
}
.protyle-wysiwyg .h1::before {
counter-increment: h1;
content: counter(h1, emoji-numbers) " ";
}
/* h2 设置并重置 h3 */
.protyle-wysiwyg .h2 {
counter-reset: h3;
}
.protyle-wysiwyg .h2::before {
counter-increment: h2;
content: counter(h1, emoji-numbers) "." counter(h2, emoji-numbers) ;
}
/* h3 设置并重置 h4 */
.protyle-wysiwyg .h3 {
counter-reset: h4;
}
.protyle-wysiwyg .h3::before {
counter-increment: h3;
content: counter(h1, emoji-numbers) "." counter(h2, emoji-numbers) "." counter(h3, emoji-numbers) ".";
}
/* h4 设置并重置 h5 */
.protyle-wysiwyg .h4 {
counter-reset: h5;
}
.protyle-wysiwyg .h4::before {
counter-increment: h4;
content: counter(h1, emoji-numbers) "." counter(h2, emoji-numbers) "." counter(h3, emoji-numbers) "." counter(h4, emoji-numbers) " ";
}
/* h5 设置并重置 h6 */
.protyle-wysiwyg .h5 {
counter-reset: h6;
}
.protyle-wysiwyg .h5::before {
counter-increment: h5;
content: counter(h1, emoji-numbers) "." counter(h2, emoji-numbers) "." counter(h3, emoji-numbers) "." counter(h4, emoji-numbers) "." counter(h5, emoji-numbers) " ";
}
/* h6 */
.protyle-wysiwyg .h6::before {
counter-increment: h6;
content: counter(h1, emoji-numbers) "." counter(h2, emoji-numbers) "." counter(h3, emoji-numbers) "." counter(h4, emoji-numbers) "." counter(h5, emoji-numbers) "." counter(h6, emoji-numbers) " ";
}
长这样:
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于