Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Show bullet threading on hover #102

Open
ChangqingW opened this issue Sep 28, 2023 · 1 comment
Open

[feature request] Show bullet threading on hover #102

ChangqingW opened this issue Sep 28, 2023 · 1 comment

Comments

@ChangqingW
Copy link
Contributor

I was wondering if it is possible to show bullet threading when hovering the block / bullet, instead of only when the block is active.

@PixelTux
Copy link

Sure! To see how it may appear, go to Settings -> General and then Edit custom.css. Add the following:

/* Block bullet path should only show in a nested block */
.ls-block {
    /* Fix for headings like h1, h2 etc */
    /* Basic "curve" */
    /* Fix multi-line blocks with children */
  }
  .ls-block .bullet {
    background-color: var(--ls-block-bullet-active-color);
    box-shadow: 0 0 0 1px var(--ls-block-bullet-active-color);
  }
  .ls-block div.block-control-wrap {
    position: relative;
    height: 26px !important;
  }
  .ls-block > .items-baseline {
    align-items: initial;
  }
  .ls-block:not(:hover) .bullet {
    background-color: var(--ls-block-bullet-color);
    transform: scale(1);
    box-shadow: none;
  }
  .ls-block:not(:hover) > .items-baseline {
    align-items: baseline;
  }
  .ls-block .ls-block > div > div.items-center::before {
    pointer-events: none;
    content: "";
    left: calc(var(--ls-block-bullet-threading-width) * -1);
    right: 20px;
    top: calc(-50% + var(--ls-block-bullet-threading-width) * 0.5 - 1px);
    bottom: 50%;
    /* shift left 1px for border */
    position: absolute;
    border-left: var(--ls-block-bullet-threading-width) solid transparent;
    border-bottom: var(--ls-block-bullet-threading-width) solid transparent;
    border-bottom-left-radius: 10px;
  }
  .ls-block .ls-block:hover > div > div.items-center::before {
    border-color: var(--ls-block-bullet-active-color);
  }
  .ls-block .block-children > .ls-block::before {
    pointer-events: none;
    content: "";
    top: -1rem;
    bottom: 0;
    border-left: var(--ls-block-bullet-threading-width) solid transparent;
    left: calc(var(--ls-block-bullet-threading-width) * -1);
    position: absolute;
  }
  .ls-block .block-children:hover > .ls-block:not(:hover)::before {
    border-color: var(--ls-block-bullet-active-color);
  }
  .ls-block .block-children:hover > .ls-block:hover ~ .ls-block::before {
    border-color: transparent;
  }
  .ls-block[haschild] > div > .block-content-wrapper::before {
    pointer-events: none;
    content: "";
    top: 12px;
    bottom: 0;
    left: -21px;
    position: absolute;
    border-left: var(--ls-block-bullet-threading-width) solid transparent;
  }
  .ls-block[haschild]:hover > div > .block-content-wrapper::before {
    border-color: var(--ls-block-bullet-active-color);
  }
  
  :is(.embed-block > div, .embed-page) > div > div > div > div.ls-block > div > div.items-center::before {
    border-color: transparent !important;
  }
  
  @media (max-width: 640px) {
    .ls-block[haschild] > div > .block-content-wrapper::before {
      left: -11px;
    }
  }

This is just a workaround and can definitely be improved, but take a look and let me know your thoughts! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants