1

In css:

  ::-webkit-scrollbar {
    width: 5px;
  }
  ::-webkit-scrollbar-thumb {
    background-color: var(--back-color);
    border-radius: 5px;
  }
  ::-webkit-scrollbar-track {
    background-color: var(--main-color);
    width: 5px;
  }

How would I specify those properties using a javascript object which would be passed into the style property of a div tag?

  • 1
    There's not a direct way to set those, here are a couple work-arounds: uses a parent-class to add/remove styles that are previously set in css: https://stackoverflow.com/a/12207551/4375502 and one that is a function to use javascript to dynamically write css to a style tag on the page: https://stackoverflow.com/a/8051488/4375502 – miir Aug 07 '21 at 04:40

0 Answers0