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

Suggestion: Line width independent of actual width #51

Open
5cript opened this issue Dec 12, 2019 · 1 comment
Open

Suggestion: Line width independent of actual width #51

5cript opened this issue Dec 12, 2019 · 1 comment

Comments

@5cript
Copy link

5cript commented Dec 12, 2019

I personally prefer finer lines, but decresing the size of the splitter line also makes the area where you can click smaller.

It'd be great if the actual line that you can click can be of any size, which contains another rectangle thats the actual line (another color), so that you dont have to be pixel perfect for clicking it.

@nathggns
Copy link

In lieu of a first party solution to this, you can achieve it with a bit of custom CSS.

.container {
  --splitter-hit-area: 7px;
  --splitter-visible-area: 1px;
  --splitter-hit-offset: calc(
    -1 * ((var(--splitter-hit-area) - var(--splitter-visible-area)) / 2)
  );
}

.container .splitter-layout > .layout-splitter {
  width: var(--splitter-visible-area);
  background: blue;
  z-index: 2;
  position: relative;
}

.container .splitter-layout > .layout-splitter:before {
  content: "";
  display: block;
  width: var(--splitter-hit-area);
  position: absolute;
  left: var(--splitter-hit-offset);
  top: 0;
  height: 100%;
}

.container .splitter-layout > .layout-splitter:hover,
.container .splitter-layout > .layout-splitter:hover:before {
  background: red;
}

.container .splitter-layout.layout-changing > .layout-splitter,
.container .splitter-layout.layout-changing > .layout-splitter:before {
  background: green;
}

.container .splitter-layout.splitter-layout-vertical > .layout-splitter {
  height: var(--splitter-visible-area);
}

.container
  .splitter-layout.splitter-layout-vertical
  > .layout-splitter:before {
  width: 100%;
  height: var(--splitter-hit-area);
  top: var(--splitter-hit-offset);
  left: 0;
}

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