Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

2.3 KB
Raw Blame
.protyle-attr {
  display: flex;
  position: absolute;
  right: 0;
  top: -12px;
  opacity: 0;
  font-size: 12px;
  font-family: var(--b3-font-family);
  font-weight: normal;
  align-items: center;
  line-height: 16px;
  // 排除跨块划选中的属性占位 https://github.com/siyuan-note/siyuan/issues/18745
  user-select: none;

  & > div {
    user-select: none;
  }

  &--av span:hover {
    color: var(--b3-protyle-inline-blockref-color);
  }

  & > div.protyle-attr--bookmark {
    flex: 1;
  }

  & > div:not(.protyle-attr--refcount) {
    margin: 0 4px;
    line-height: 16px;
    color: var(--b3-theme-on-surface);
    min-width: 12px;

    &.protyle-attr--memo svg {
      margin-right: 0;
    }

    &:hover {
      color: var(--b3-theme-on-background);
    }

    svg {
      height: 12px;
      width: 12px;
      margin: 2px 2px 2px 0;
      float: left;
    }
  }

  &--refcount {
    right: -16px;
    top: 12px; // https://github.com/siyuan-note/siyuan/issues/8784
    position: absolute;
    line-height: 16px;
    padding: 0 4px;
    color: var(--b3-theme-on-surface);
    border-radius: var(--b3-border-radius);
    font-size: 12px;
    user-select: none;
    cursor: pointer;
    height: 16px;
    background-color: var(--b3-theme-surface);
    z-index: 7; // 防止被图片缩放手柄和 protyle-scroll 遮挡
    white-space: nowrap;

    &:hover {
      color: var(--b3-theme-on-background);
      background-color: var(--b3-theme-surface-lighter);
    }
  }

  &:empty {
    display: none;
  }
}

// 为页签块、嵌入块及超级块后方的属性行留出空间,避免与前方容器的边界重叠。
.protyle-wysiwyg--attr {
  :is([data-type="NodeTabs"], [data-type="NodeBlockQueryEmbed"], [data-type="NodeSuperBlock"]) + [data-node-id],
  :is([data-type="NodeTabs"], [data-type="NodeBlockQueryEmbed"], [data-type="NodeSuperBlock"]) +
  .sb[data-sb-layout="row"] > [data-node-id]:first-child {
    &:is([name]:not([name=""]), [alias]:not([alias=""]), [memo]:not([memo=""]),
    [bookmark]:not([bookmark=""]), [av-names]:not([av-names=""])) {
      margin-top: 16px;
    }
  }
}

// 三击时恢复属性容器可选,以保留浏览器的整段选择行为 https://github.com/siyuan-note/siyuan/issues/16829
.protyle-wysiwyg--select-attr .protyle-attr {
  user-select: auto;
}