为啥论坛里的子弹线列表 css 都不行了,我新建了个空间测试也不行

  • 思源笔记

    思源笔记是一款隐私优先的个人知识管理系统,支持完全离线使用,同时也支持端到端加密同步。

    融合块、大纲和双向链接,重构你的思维。

    25730 引用 • 106472 回帖
  • Q&A

    提问之前请先看《提问的智慧》,好的问题比好的答案更有价值。

    9858 引用 • 44812 回帖 • 78 关注
1 操作
JeffreyChen 在 2025-03-08 16:28:06 更新了该帖

相关帖子

被采纳的回答
  • Imuvux 1

    可以用 Savor 主题的子弹线样式(个人调整了非列表块顶层时的显示问题、非 Savor 主题激活节点显示)。

    css 代码:

    .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { content: ''; display: block; box-sizing: border-box; border-left: 2px solid var(--b3-theme-primary); border-bottom: 2px solid var(--b3-theme-primary); border-bottom-left-radius: 8px; position: absolute; left: -18px; } [data-subtype="u"] .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { width: 32px; height: calc(var(--en-bullet-line-height) - 1px); top: calc(var(--en-bullet-line-height) * -1 + 20px); } [data-subtype="o"] .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { width: 24px; height: calc(var(--en-bullet-line-height) - 8px); top: calc(var(--en-bullet-line-height) * -1 + 25px); } [data-subtype="t"] .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { width: 30px; height: calc(var(--en-bullet-line-height) - 4px); top: calc(var(--en-bullet-line-height) * -1 + 21px); } /* 激活状态样式 */ [data-subtype="u"] .en_item_bullet_actived>.protyle-action, [data-subtype="u"] .en_item_bullet_actived>.protyle-action::before, [data-subtype="u"] .en_item_bullet_actived>.protyle-action::after { color: var(--b3-theme-primary) !important; } [data-subtype="o"] .en_item_bullet_actived>.protyle-action::after { background-color: var(--b3-theme-primary); } [data-subtype="t"] .en_item_bullet_actived>.protyle-action--task, [data-subtype="t"] .en_item_bullet_actived>.protyle-action--task::before, [data-subtype="t"] .en_item_bullet_actived>.protyle-action--task::after { color: var(--b3-theme-primary) !important; }

    js 代码:

    allListItemNode = [] document.addEventListener('selectionchange', () => { const selection = window.getSelection() if (!selection.rangeCount) { return } const range = selection?.getRangeAt(0) const startNode = range?.startContainer let currentNode = startNode allListItemNode.forEach((node) => { node.classList.remove('en_item_bullet_actived') node.classList.remove('en_item_bullet_line') }) allListItemNode = [] while (currentNode) { if (currentNode?.dataset?.type === 'NodeListItem') { allListItemNode.push(currentNode) } currentNode = currentNode.parentElement } for (let i = 0; i < allListItemNode.length - 1; i++) { const currentNode = allListItemNode[i] const currentRect = currentNode.getBoundingClientRect() const nextNode = allListItemNode[i + 1] const nextRect = nextNode.getBoundingClientRect() const height = currentRect.top - nextRect.top currentNode.style.setProperty('--en-bullet-line-height', `${height}px`) currentNode.classList.add('en_item_bullet_line') } allListItemNode.forEach((node) => { node.classList.add('en_item_bullet_actived') }) })

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...
  • 用插件试试:

    image.png

    1 回复
  • ioypl

    这个插件可以,但是会导致 bug,出现莫名的东西。

    1、列表后转标题出现 bug

    PixPin20250308164756.png

    2、层级多了,就出现莫名元素,导致下层无法选中。

    PixPin20250308164856.png

    1 回复
    1. 可能跟你的什么样式冲突了,我这里看起来没问题:

      image.png

    2. 这个是伪元素的样式问题,我这里是能选中块的

  • Imuvux 1 1 评论

    可以用 Savor 主题的子弹线样式(个人调整了非列表块顶层时的显示问题、非 Savor 主题激活节点显示)。

    css 代码:

    .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { content: ''; display: block; box-sizing: border-box; border-left: 2px solid var(--b3-theme-primary); border-bottom: 2px solid var(--b3-theme-primary); border-bottom-left-radius: 8px; position: absolute; left: -18px; } [data-subtype="u"] .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { width: 32px; height: calc(var(--en-bullet-line-height) - 1px); top: calc(var(--en-bullet-line-height) * -1 + 20px); } [data-subtype="o"] .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { width: 24px; height: calc(var(--en-bullet-line-height) - 8px); top: calc(var(--en-bullet-line-height) * -1 + 25px); } [data-subtype="t"] .en_item_bullet_line:not(.protyle-wysiwyg--select)::after { width: 30px; height: calc(var(--en-bullet-line-height) - 4px); top: calc(var(--en-bullet-line-height) * -1 + 21px); } /* 激活状态样式 */ [data-subtype="u"] .en_item_bullet_actived>.protyle-action, [data-subtype="u"] .en_item_bullet_actived>.protyle-action::before, [data-subtype="u"] .en_item_bullet_actived>.protyle-action::after { color: var(--b3-theme-primary) !important; } [data-subtype="o"] .en_item_bullet_actived>.protyle-action::after { background-color: var(--b3-theme-primary); } [data-subtype="t"] .en_item_bullet_actived>.protyle-action--task, [data-subtype="t"] .en_item_bullet_actived>.protyle-action--task::before, [data-subtype="t"] .en_item_bullet_actived>.protyle-action--task::after { color: var(--b3-theme-primary) !important; }

    js 代码:

    allListItemNode = [] document.addEventListener('selectionchange', () => { const selection = window.getSelection() if (!selection.rangeCount) { return } const range = selection?.getRangeAt(0) const startNode = range?.startContainer let currentNode = startNode allListItemNode.forEach((node) => { node.classList.remove('en_item_bullet_actived') node.classList.remove('en_item_bullet_line') }) allListItemNode = [] while (currentNode) { if (currentNode?.dataset?.type === 'NodeListItem') { allListItemNode.push(currentNode) } currentNode = currentNode.parentElement } for (let i = 0; i < allListItemNode.length - 1; i++) { const currentNode = allListItemNode[i] const currentRect = currentNode.getBoundingClientRect() const nextNode = allListItemNode[i + 1] const nextRect = nextNode.getBoundingClientRect() const height = currentRect.top - nextRect.top currentNode.style.setProperty('--en-bullet-line-height', `${height}px`) currentNode.classList.add('en_item_bullet_line') } allListItemNode.forEach((node) => { node.classList.add('en_item_bullet_actived') }) })
    4 回复
    1 操作
    Imuvux 在 2025-03-26 01:08:42 更新了该回帖
    这个是 OK 的,感谢分享!
    veryzhh
  • 我也遇到这个问题。

  • ioypl 1 评论

    可以了,怎么修改线的颜色

    css 第 5, 6 行的 var(--b3-theme-primary) 替换成颜色代码
    Imuvux
  • Wetoria 2 评论 via macOS

    这代码怎么看着这么眼熟 @royc1

    听说 Savor 某版更新就是得了 VV 佬斧正,都吹爆
    Imuvux
    @Imuvux 叶归的超级块宽度滑杆其实也是 R 佬催更出来的功能
    Wetoria
  • Savor 是唯一不冲突不变形的.

  • 就是 VV 佬的作品,效率最大化提升 @Wetoria

  • 奇了怪了,睡一觉起来,子弹线又不显示了。

    新代码也不行,在新空间里也不行。只有 Savor 的子弹线能稳定显示。

    刚从 Savor 切换到其他主题,子弹线代码是有效的,但重启思源后就又无效了。

    就好像有什么隐秘的开关,需要被开启,才可以。

    1 回复
  • 从 Savor 切换到其他主题,子弹线代码是有效的

    看起来像是 Savor 的 JS 没卸载干净,所以才有效

    1 操作
    JeffreyChen 在 2025-03-09 15:18:30 更新了该回帖
    但我在一个只装了默认主题和子弹线 CSS 的新工作空间里,也是不能显示子弹线。Savor 的 JS 会影响到新空间吗?
    veryzhh
    @veryzhh 不会
    JeffreyChen
请输入回帖内容 ...

推荐标签 标签

  • 百度

    百度(Nasdaq:BIDU)是全球最大的中文搜索引擎、最大的中文网站。2000 年 1 月由李彦宏创立于北京中关村,致力于向人们提供“简单,可依赖”的信息获取方式。“百度”二字源于中国宋朝词人辛弃疾的《青玉案·元夕》词句“众里寻他千百度”,象征着百度对中文信息检索技术的执著追求。

    63 引用 • 785 回帖 • 87 关注
  • Linux

    Linux 是一套免费使用和自由传播的类 Unix 操作系统,是一个基于 POSIX 和 Unix 的多用户、多任务、支持多线程和多 CPU 的操作系统。它能运行主要的 Unix 工具软件、应用程序和网络协议,并支持 32 位和 64 位硬件。Linux 继承了 Unix 以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。

    954 引用 • 944 回帖 • 1 关注
  • JRebel

    JRebel 是一款 Java 虚拟机插件,它使得 Java 程序员能在不进行重部署的情况下,即时看到代码的改变对一个应用程序带来的影响。

    26 引用 • 78 回帖 • 678 关注
  • Logseq

    Logseq 是一个隐私优先、开源的知识库工具。

    Logseq is a joyful, open-source outliner that works on top of local plain-text Markdown and Org-mode files. Use it to write, organize and share your thoughts, keep your to-do list, and build your own digital garden.

    7 引用 • 69 回帖 • 8 关注
  • 宕机

    宕机,多指一些网站、游戏、网络应用等服务器一种区别于正常运行的状态,也叫“Down 机”、“当机”或“死机”。宕机状态不仅仅是指服务器“挂掉了”、“死机了”状态,也包括服务器假死、停用、关闭等一些原因而导致出现的不能够正常运行的状态。

    13 引用 • 82 回帖 • 77 关注
  • OnlyOffice
    4 引用 • 25 关注
  • Typecho

    Typecho 是一款博客程序,它在 GPLv2 许可证下发行,基于 PHP 构建,可以运行在各种平台上,支持多种数据库(MySQL、PostgreSQL、SQLite)。

    12 引用 • 67 回帖 • 447 关注
  • 反馈

    Communication channel for makers and users.

    121 引用 • 907 回帖 • 278 关注
  • Spark

    Spark 是 UC Berkeley AMP lab 所开源的类 Hadoop MapReduce 的通用并行框架。Spark 拥有 Hadoop MapReduce 所具有的优点;但不同于 MapReduce 的是 Job 中间输出结果可以保存在内存中,从而不再需要读写 HDFS,因此 Spark 能更好地适用于数据挖掘与机器学习等需要迭代的 MapReduce 的算法。

    74 引用 • 46 回帖 • 565 关注
  • 阿里云

    阿里云是阿里巴巴集团旗下公司,是全球领先的云计算及人工智能科技公司。提供云服务器、云数据库、云安全等云计算服务,以及大数据、人工智能服务、精准定制基于场景的行业解决方案。

    84 引用 • 324 回帖 • 1 关注
  • Gzip

    gzip (GNU zip)是 GNU 自由软件的文件压缩程序。我们在 Linux 中经常会用到后缀为 .gz 的文件,它们就是 Gzip 格式的。现今已经成为互联网上使用非常普遍的一种数据压缩格式,或者说一种文件格式。

    9 引用 • 12 回帖 • 173 关注
  • 一些有用的避坑指南。

    69 引用 • 93 回帖
  • golang

    Go 语言是 Google 推出的一种全新的编程语言,可以在不损失应用程序性能的情况下降低代码的复杂性。谷歌首席软件工程师罗布派克(Rob Pike)说:我们之所以开发 Go,是因为过去 10 多年间软件开发的难度令人沮丧。Go 是谷歌 2009 发布的第二款编程语言。

    499 引用 • 1395 回帖 • 246 关注
  • Windows

    Microsoft Windows 是美国微软公司研发的一套操作系统,它问世于 1985 年,起初仅仅是 Microsoft-DOS 模拟环境,后续的系统版本由于微软不断的更新升级,不但易用,也慢慢的成为家家户户人们最喜爱的操作系统。

    227 引用 • 476 回帖
  • Unity

    Unity 是由 Unity Technologies 开发的一个让开发者可以轻松创建诸如 2D、3D 多平台的综合型游戏开发工具,是一个全面整合的专业游戏引擎。

    25 引用 • 7 回帖 • 122 关注
  • FreeMarker

    FreeMarker 是一款好用且功能强大的 Java 模版引擎。

    23 引用 • 20 回帖 • 465 关注
  • etcd

    etcd 是一个分布式、高可用的 key-value 数据存储,专门用于在分布式系统中保存关键数据。

    6 引用 • 26 回帖 • 544 关注
  • 互联网

    互联网(Internet),又称网际网络,或音译因特网、英特网。互联网始于 1969 年美国的阿帕网,是网络与网络之间所串连成的庞大网络,这些网络以一组通用的协议相连,形成逻辑上的单一巨大国际网络。

    98 引用 • 367 回帖
  • 又拍云

    又拍云是国内领先的 CDN 服务提供商,国家工信部认证通过的“可信云”,乌云众测平台认证的“安全云”,为移动时代的创业者提供新一代的 CDN 加速服务。

    20 引用 • 37 回帖 • 579 关注
  • gRpc
    11 引用 • 9 回帖 • 95 关注
  • InfluxDB

    InfluxDB 是一个开源的没有外部依赖的时间序列数据库。适用于记录度量,事件及实时分析。

    2 引用 • 96 关注
  • V2EX

    V2EX 是创意工作者们的社区。这里目前汇聚了超过 400,000 名主要来自互联网行业、游戏行业和媒体行业的创意工作者。V2EX 希望能够成为创意工作者们的生活和事业的一部分。

    16 引用 • 236 回帖 • 255 关注
  • ZeroNet

    ZeroNet 是一个基于比特币加密技术和 BT 网络技术的去中心化的、开放开源的网络和交流系统。

    1 引用 • 21 回帖 • 649 关注
  • LaTeX

    LaTeX(音译“拉泰赫”)是一种基于 ΤΕΧ 的排版系统,由美国计算机学家莱斯利·兰伯特(Leslie Lamport)在 20 世纪 80 年代初期开发,利用这种格式,即使使用者没有排版和程序设计的知识也可以充分发挥由 TeX 所提供的强大功能,能在几天,甚至几小时内生成很多具有书籍质量的印刷品。对于生成复杂表格和数学公式,这一点表现得尤为突出。因此它非常适用于生成高印刷质量的科技和数学类文档。

    12 引用 • 59 回帖 • 5 关注
  • Hadoop

    Hadoop 是由 Apache 基金会所开发的一个分布式系统基础架构。用户可以在不了解分布式底层细节的情况下,开发分布式程序。充分利用集群的威力进行高速运算和存储。

    90 引用 • 122 回帖 • 624 关注
  • Webswing

    Webswing 是一个能将任何 Swing 应用通过纯 HTML5 运行在浏览器中的 Web 服务器,详细介绍请看 将 Java Swing 应用变成 Web 应用

    1 引用 • 15 回帖 • 638 关注
  • Android

    Android 是一种以 Linux 为基础的开放源码操作系统,主要使用于便携设备。2005 年由 Google 收购注资,并拉拢多家制造商组成开放手机联盟开发改良,逐渐扩展到到平板电脑及其他领域上。

    336 引用 • 324 回帖 • 1 关注