James
James

Reputation: 148

webkit-transform on overflow:auto div results in very wide scrollbar in Chrome/Safari

I am using a content editable div with "overflow: auto" and "-webkit-transform: scaleX(1.3)". The transform causes the scroll bar to become very wide in Chrome/Safari on OS X and in Chrome on Windows. My question:


Additional details:

Upvotes: 0

Views: 628

Answers (1)

joydesigner
joydesigner

Reputation: 813

Because you -webkit-transform scaled the whole elements 1.1 times of the size, so you need use the ::-webkit-scrollbar to customize the scrollbar style.

Also you need to use other -webkit-scrollbar pseudo elements to customize the style of the scrollbar.

Here is the DEMO.

::-webkit-scrollbar {
  width: 12px;
 }

::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
  border-radius: 10px;
 }

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
 }

If you need the default style, you need to do more css customize based on the demo.

Hope this can help.

Upvotes: 1

Related Questions